Le 28/02/2011 13:18, Carlos Sánchez a écrit :
Hi All,

Is there any way to expose some Bundle configuration parameters loaded
into DIC to the template engine (particularity twig)?

Like some request parameters are:
        {{ app.request.query.get('page') }}
        {{ app.request.parameter('page') }}


Thanks in advanced.
you can add globals variables in the project config:

twig:
    globals:
        pi: 3.14
        foobar: baz

If you provide a third-party bundle, the solution is to define a Twig extension and define the global variables with the getGlobals() method of the extension. This is the way TwigBundle does to add the app variable in the templates.

Regards

--
Christophe | Stof

--
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

Reply via email to