Location rendering template in symfony2

Where is the rendering template running in symfony2?

I ask that the most general class / method handle template logic, I suppose by running a configured template engine, like Twig.

Or put the question even more specifically ... the controller delegates the layout to a specific template, for example example.html.twig ... where is this file name used and transmitted for the first time?

+7
source share
1 answer

In the most general case, assuming you are using a FrameworkBundle (if you are using the standard version, you are), the render function simply calls $this->container->get('templating')->renderResponse , just by going through the parameters.

Engines (such as a branch engine) implement Symfony\Component\Templating\EngineInterface .

You can check vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php (and other relevant files, such as those in TwigBundle) if you want to carefully study how this works.

+4
source

All Articles