Zeelot/kohana-assets — pull request #6 by rafi (2013-05-22 15:13:41+00:00)
Title: Added `pass` method to pipeline variables into Javascript

You can pipeline server-side information into client-side Javascript variables using the `pass` method:

$this->assets->pass([
'route' => [
'name' => Route::name($this->request->route()),
'controller' => strtolower($this->request->controller()),
'action' => $this->request->action()
],
'url' => [
'base' => URL::base(),
'media' => URL::base().Media::uri('/').'/'
],
'environment' => Kohana::$environment
]);

When you use `Assets::get()` to retrieve all the `head` assets, data will be encoded like this:

In Javascript, your variables are set and ready to use within the `window.pass` global variable.