What is the correct procedure to install jquery in my project symfony2. It is necesary create a new bundle and install there?
Asked
Active
Viewed 348 times
1 Answers
1
a best practice is to keep all your assets in the Symfony/web
directory. I would create a js
folder in the web directory and simply copy your jquery.js file into the js folder. Then when you want to include the script in your twig template, all you need to do is
<script src="{{ asset('js/jquery.js') }}" type="text/javascript"></script>
There are many ways to manage your assets, for more info, see the Symfony docs for managing assets

Sehael
- 3,678
- 21
- 35
-
I did it. But I can not get a result in my template... – user3276498 Mar 20 '14 at 03:02