webvariants/sly-assetic

AddOn for SallyCMS, handling assets using assetic

v1.1.0 2016-05-17 14:54 UTC

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 addon develop directory.
  • Inherit your layout from sly_Layout_Assetic to use the methods addCSSAsset and addJavaScriptAsset to add CSS and JS to your HTML. (Do not forget to call parent::__construct() of sly_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__.