Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8400609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:36:02+00:00 2026-06-09T21:36:02+00:00

I am new in Symfony2 framework and not fully understand how to work with

  • 0

I am new in Symfony2 framework and not fully understand how to work with javascripts and how to include theirs in the best way.

What I need: to include jQuery script to each page.

What I have: I have common layout like this:

<!DOCTYPE html>
<html>
    <head>
        {% block javascripts %}{% endblock %}
    </head>
    <body>
        {% block body %}{% endblock %}

    </body>
</html>

Where jquery.js should be placed. What about web/bundles/jquery? Or there are some special official jquery bundles? Should I use asset() and how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:36:04+00:00Added an answer on June 9, 2026 at 9:36 pm

    Assuming your jquery.min.js is placed under
    src/Acme/FooBundle/Resources/public/js/

    You can use either

    <script type="text/javascript" src="{{ asset('bundles/acmefoo/js/jquery.min.js') }}"></script>
    

    or

    {% javascripts
        '@AcmeFooBundle/Resources/public/js/jquery.min.js'
    %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}
    

    Into your twig template.

    Make sure you installed the assets afterwards or run this command

    php app/console assets:install web --symlink
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to the Symfony Framework and currently searching for the Best-Practice way
Im new in symfony2 framework and i don't know how to store application settings
I'm very new to Symfony2 and I need to be able to test the
New to Symfony2. I followed several tutorials to install & configure Sonata with FOSUser
I've been using Symfony for a long time but I'm new to Symfony2. After
I have a strange kind of problem. I'm totally new to symfony2 so forgive
I would like to load a new extension in a symfony2 project for twig
I want to use SwiftMailer in Symfony2. To start with, I created a new
I'm using Symfony2 Framework, and I want to update an entity with data from
i am trying to setup a new symfony framework project on ubuntu by following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.