symfony/symfony — pull request #7275 by sumkincpp (2013-03-05 22:30:31+00:00)
Title: [Twig] asset extended helper

Matching for js or css file with * in `asset` helper, the first matched asset file will be included.

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | symfony/symfony-docs#2276

For code

resulting template will include link to /js/jquery-1.8.3.js if it exists.

It is useful when you want to use assets from bundles supplied by third-party vendors.

The same feature exists in AsseticBundle, but It could be heavy or not neccessary to recreate static file from public folder. Also we need to write more code for same behavior, e.g.

{% javascripts 'js/jquery*.js' %}

{% endjavascripts %}