Skip to content

AMgrade/bifrost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bifrost

This package deleloped to be like a bridge between PHP and JavaScript.

Installation

composer require amgrade/bifrost

Usage

// Somewhere in your controller class.
\AMgrade\Bifrost\Bifrost::push(['foo' => 'bar', 'baz' => 'foo']);
// Later in your view (e.g. Laravel Blade).
<head>
...
{!! \AMgrade\Bifrost\Bifrost::toHtml() !!}
</head>
// In your JS app.
console.log(window.Bifrost.foo);
console.log(window.Bifrost.baz);

Configuration

You can pass your own namespace to prevent name conflicts.

<head>
...
{!! \AMgrade\Bifrost\Bifrost::toHtml('YOUR_NAMESPACE') !!}
</head>
// In your JS app.
console.log(window.YOUR_NAMESPACE.foo);
console.log(window.YOUR_NAMESPACE.baz);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages