How can i add some jQuery plugin to a Symfony 2.1 project?
I install all frontend assets with the composer so all plugins are stored in the Symfony/vendor directory.
I can specify JS-file to load in a template like this:
{% javascripts filter='?yui_js' output='js/compiled/plugins.js'
'%kernel.root_dir%/../vendor/author/plugin1/plugin.js'
'%kernel.root_dir%/../vendor/author/plugin2/plugin.js'
'%kernel.root_dir%/../vendor/author/plugin3/plugin.js'
%}
And after calling:
php ./app/console assetic:dump ...
All specified files will be compiled and placed under the Symfony/web directory.
But what if some plugin requires more than just a single JS or CSS file? What if it needs to load some images, styles or scripts dynamically from inside a plugin directory (which is out of web-server's document root)?