webvariants / sly-assetic
AddOn for SallyCMS, handling assets using assetic
v1.1.0
2016-05-17 14:54 UTC
Requires
- php: >=5.3.3
- kriswallsmith/assetic: 1.1.1
- sallycms/composer-installer: ~1.1
- sallycms/console: >=0.9,<0.11
- sallycms/sallycms: >=0.9,<0.11
This package is auto-updated.
Last update: 2020-08-10 14:15:18 UTC
README
1. Usage
- Define all your assets in
develop/config/assetic.yml
. Look for the example in the addondevelop
directory. - Inherit your layout from
sly_Layout_Assetic
to use the methodsaddCSSAsset
andaddJavaScriptAsset
to add CSS and JS to your HTML. (Do not forget to callparent::__construct()
ofsly_Layout_Assetic
.) (ex.$layout->addCSSAsset('main.css')
); - In developer mode all assets are build on the fly.
- In production mode static files are served. You have to rebuild them manually
with the console:
php sally/console/bin/console assetic:rebuild
every time. The static files are placed inside the assets directory and prefixed with__assetic__
.