Hi,
You should get what you want with this in your controller :
$environement = $this->container->get('kernel')->getEnvironment();
then you need to setup a :
{% if is "dev %}
// display something for the dev environement
{% else%}
{% endif%}
On 19 oct, 15:31, Francois Mazerolle <[email protected]>
wrote:
> Hi,
>
> I'm trying to make a bundle that add a functionality to the twig
> rendering process.
> Basically, I need Twig to call a custom function before the
> doDisplay() method is called.
>
> To explain a bit the context, when in development mode, I need to wrap
> the content of
> each template file into a custom <div>, and add a couple of info.
>
> Looking at the Twig_Template and the cached template, I see no trace
> of hooks or event, and
> doesn't see how I could integrate that kind of feature without
> modifying directly the file.
>
> Tips&hints would be welcome.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en