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

  • Home
  • SEARCH
  • 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 8706117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:32:11+00:00 2026-06-13T03:32:11+00:00

I try to load a simple base.html.twig template file that was moved from symfony’s

  • 0

I try to load a simple base.html.twig template file that was moved from symfony’s default location app/Resources/views/ to the custom location theme/.

The template file contains:

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

Extending the above template file by the controller Acme\Core\CoreBundle\Controller by using the controller-specific template

    {% extends '::base.html.twig' %}
    {% block body %}
      Hello world!
    {% endblock %}

leads to an error saying Unable to find template "::base.html.twig" in "AcmeCoreCoreBundle:Default:index.html.twig"..

How is it possible to tell symfony where to find the template files in global space?

Thanks in advance.

  • 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-13T03:32:12+00:00Added an answer on June 13, 2026 at 3:32 am

    Due to Adam’s hint I am able to answer the question on my own. So I want to provide my answer if anybody is interested in.

    The AcmeDemoBundle provides a twig extension (class Acme\DemoBundle\Twig\Extension\DemoExtension) that you simply can use. Change the constructor to

        public function __construct(FilesystemLoader $loader)
        {
         $this->loader = $loader;
         $this->loader->addPath('path/to/your/directory');
        }
    

    Now tell symfony to register the twig extension. Edit your config.yml file (e.g. app/config/config.yml) and append

        services:
         demo.twig.extension
          class: Acme\DemoBundle\Twig\Extension\DemoExtension
          tags:
           - { name: twig.extension }
          arguments:
           - @Twig.loader
    

    Last but not least change your extending twig file and remove the :: from your default template’s namespace:
    {% extends 'base.html.twig' %}.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a simple strict HTML file that includes jquery: <?xml version=1.0
I try to load the customview class that is inside my mainclass in xml.
I try to load files in different categories according to theis file name. Till
i have the following code to try and load a local html page in
I try to load image with processing.js using CoffeeScript and write this simple code:
I am creating simple console application where I need to load RTF file to
I have very simple XML in a string that I'm trying to load via
I have a singleton, that is an image manager. When I try to load
I'm trying to load a simple plist file in XCode 4 for an iPad
I try to load a simple DLL compiled with GCC in cygwin into a

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.