0

What is the correct procedure to install jquery in my project symfony2. It is necesary create a new bundle and install there?

1 Answers1

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