Skip to content

Commit

Permalink
minor #6794 Added a new section to the page templating/global_vars us…
Browse files Browse the repository at this point in the history
…ing a EVListener (piet, Piet Bijl)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #6794).

Discussion
----------

Added a new section to the page templating/global_vars using a EVListener

Added another option for injecting variables into templates through the use of a event listener, also added a DC/removal notice on twigs getGlobals

Commits
-------

ef1c2fd Added a new section to the page templating/global_vars using a EVListener
  • Loading branch information
wouterj committed Aug 11, 2016
2 parents b265132 + ef1c2fd commit c8c9f17
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions templating/global_variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,4 @@ This should feel familiar, as it's the same syntax you use in service configurat
'globals' => array(
'user_management' => '@app.user_management',
),
));
Using a Twig Extension
----------------------

If the global variable you want to set is more complicated - say an object -
then you won't be able to use the above method. Instead, you'll need to create
a :ref:`Twig Extension <reference-dic-tags-twig-extension>` and return the
global variable as one of the entries in the ``getGlobals`` method.
));

0 comments on commit c8c9f17

Please sign in to comment.