Asset Manipulation

Once in a while, for reasons of the front end requirements you may need to change the order of the assets. If you are say adding your custom.css file to the array in your _init.php file, and then again later adding a bunch of theme specific files in a /themes/mytheme/_theme_init.php file, you may need to then push the custom.css file back to the end.

pushAsset($type, $key)

// Example

$theme->pushAsset('custom', 'stylesheets');

Push the custom.css to the end of the stylesheet array

unshiftAsset($type, $key)

// Example

$theme->unshiftAsset('custom', 'stylesheets');

Move the custom.css to the beginning of the stylesheet array

Last updated