I'm using Symfony2.
How can I access parameters defined in parameters.yml from within a twig template ?
Thanks.
Define it in config.yml
like this:
twig:
globals:
some_key: %some_key%
and then use in twig files like:
{{ some_key }}
For security reasons you can't get access to data from parameters.yml
in the templates without defining global twig variables.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments