-
Notifications
You must be signed in to change notification settings - Fork 4
Output assets
edmundask edited this page Mar 26, 2012
·
2 revisions
With Sprinkle you can output a specific asset group, only CSS or JS assets or all of them.
<?php
// Will output a group called 'js-libs'
echo $this->sprinkle->output('js-libs');
?>
<?php
// Will only output CSS assets
echo $this->sprinkle->output('css');
?>
<?php
// Will only output Javascript assets
echo $this->sprinkle->output('js');
?>
<?php
// Let's output them all!
echo $this->sprinkle->output();
?>
Note that by saying "output all assets" here we have in mind those assets that have been automatically loaded based on the route or those which have been manually loaded from the controller.
But wait, there's more. You can also output only js or css assets for a specific group!
<?php
// Will output js assets from the asset group named "application"
echo $this->sprinkle->output('application', 'js');
?>