Reputation: 6269
How can I include a javascript file from my Bundle CompetitiongameBundle, in a twig file ? What does the asset function mean ?
Upvotes: 2
Views: 3541
Reputation: 22817
Don't you trust symfony docs?
You can also include assets located in your bundles' Resources/public folder. You will need to run the php app/console assets:install target [--symlink] command, which moves (or symlinks) files into the correct location. (target is by default "web").
<link href="{{ asset('bundles/acmedemo/css/contact.css') }}" type="text/css" rel="stylesheet" />
I don't advice to you link against individual resources from bundle - use Assetic for that, possibly minifying them.
Upvotes: 4