chh / pipe-silex
Silex Extension which integrates an Asset Pipeline
Requires
- chh/jazz: ~1.0
- chh/pipe: 1.0.*@dev
- silex/silex: ~1.0
Requires (Dev)
- twig/twig: ~1.0
This package is not auto-updated.
Last update: 2024-10-26 14:46:01 UTC
README
Install
If you haven't got Composer:
wget http://getcomposer.org/composer.phar
Then install with:
php composer.phar require chh/pipe-silex:*@dev
Usage
Configuration Options
pipe.root
: Use the default load path setup, based on this root directory. The pathsjavascripts/
,stylesheets/
,vendor/javascripts
andvendor/stylesheets
are added to your load path by default.pipe.load_path
(default[]
): Create a custom load path setup by setting this as array, e.g.$app['pipe.load_path'] = [__DIR__ . '/css', __DIR__ . '/js']
.pipe.use_precompiled
(default:false
): Point links generated with the helpers to precompiled versions of assets.pipe.use_precompiled_gzip
(default:true
): Use gzipped precompiled assets if possible.pipe.precompile
(default:['application.js', 'application.css']
): List of files which should be dumped to the filesystem when theprecompile
method was invoked.pipe.precompile_directory
Output path for theprecompile
method.pipe.js_compressor
(default:''
): Javascript compressor for use on precompile. Available isyuglify_js
oruglify_js
.pipe.css_compressor
(default:''
): CSS compressor which is used on precompile, Available is onlyyuglify_css
.pipe.debug
(default:false
): Skip compression of assets.pipe.prefix
(default:''
): Asset link prefix, which is used when precompiled assets are used.pipe.manifest
(default:''
): Location of themanifest.json
created on precompile. Usually found inside thepipe.precompile_directory
.
Services
pipe
: Provides helper methods for precompiling and linking to assets.precompile()
: Precompiles assets set inpipe.precompile
to static files which include a cache buster, and themanifest.json
.assetLink($logicalPath)
: Creates a URL to the given asset. Respectspipe.use_precompiled
, and either points to the dynamic asset generation, or to static files.assetLinkTag($logicalPath)
: UsesassetLink
to create<script>
or<link>
tags depending on the Content Type of the asset.
pipe.environment
:Pipe\Environment
instance which is used by thepipe
service.
Twig Extensions
pipe_link(logicalPath)
: Same as thepipe
service'sassetLink
helper.pipe_link_tag(logicalPath)
: Same as the service'sassetLinkTag
helper.
License
The MIT License
Copyright (c) 2012 Christoph Hochstrasser
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.