Provides an additional filter for Assetic: asset directory.
This filter will process your CSS and copy assets to a directory, usually in web/
folder.
By doing so, you can include CSS images and fonts from external libraries without storing dependency in a public folder.
Edit your composer.json and add the following package as a require:
{
"require": {
"alexandresalome/assetic-extra-bundle": "dev-master"
}
}Edit your app/AppKernel.php and add the bundle to the registerBundles method:
public function registerBundles()
{
$bundles = array(
// ...
new Alex\AsseticExtraBundle\AlexAsseticExtraBundle(),
// ...Edit your config.yml and add a section alex_assetic_extra:
alex_assetic_extra:
asset_directory:
enabled: true
# Indicates where assets should be copied to
# when processing CSS files.
path: %kernel.root_dir%/../web/assets
# Not really clear yet
target: assetsOr to quickly use it:
alex_assetic_extra:
asset_directory: trueTo use it, use the filter in your {% stylesheets %} template blocks:
{% stylesheets filter="combine,assetdirectory"
"@SomeBundle/Resources/assets/form.css"
"../vendor/path/to/some.js"
%}
{# ... #}
{% endstylsheets %}v0.1
- Initial version