# sfMinify plugin Integrates the minify library see [http://code.google.com/p/minify/](http://code.google.com/p/minify/ "minify") into symfony. ## Overview Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads. Names the combined, minified files based on the modification time of each component file, so editing CSS or JavaScript files will cause a new combined version to be created automatically. This makes it easier to set far-future expiry dates on assets. Based on sfMinifyPlugin by Gordon Franke. Adds support for unique file names based on modification times of combined files. ## Usage * create a symlink in your web directory pointing to ``plugins/sfMinifyTSPlugin/web/`` or run ``symfony plugin:publish-assets`` * clear the symfony cache with ``symfony cc`` * then run ``symfony minify:permissions`` ### Filter or Helper you can activate minify over as a filter or with helpers * change the common filter in your ``filters.yml`` to [plain] common: class: sfMinifyTSFilter # Filter class param: javascripts: true stylesheets: true * or add/change the helper in your layout file (default ``layout.php``) to [php] use_helper('SfMinifyTS'); minify_include_javascripts(); minify_include_stylesheets(); ### Configuration you can enable and disable javascript or stylesheet minify by setting the params in ``filter.yml`` by default both types will be minified #### Compression to compress the files simply set the ``compressed`` option to on in ``settings.yml`` [plain] all: .settings: compressed: on ## Tasks This package provides 2 tasks: * ``minify:clear-cache`` - extends the default symfony ``clear-cache`` task to clear the minify cache directory as well. It also adds a new type ``minify`` to only clear the minify cache. * ``minify:fix-permissions`` - fixes the permissions on the minify cache directory to make it world-writeable