Skip to content

Conversation

stof
Copy link
Member

@stof stof commented Oct 13, 2012

This makes the app global variable available also when accessing the Twig
environment directly instead of using the TwigEngine.

stof added 2 commits October 13, 2012 17:19
This makes the app global variable available also when accessing the Twig
environment directly instead of using the TwigEngine.
@@ -75,8 +75,6 @@ public function panelAction(Request $request, $token)
'request' => $request,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'is_ajax' => $request->isXmlHttpRequest(),
// for BC compatibility
'app' => array('request' => $request),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be kept as app may not be available when not using the full-stack framework.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, do we really need to provide BC outside the full-stack framework ? The profiler was not supported outside the framework previously.

thus, if you really want to provide BC, you should provide it for all methods of the GlobalVariables class, not only for the Request getter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and btw, this would break the BC for the full-stack framework as you would be replacing the app variable with a variable providing less stuff.

fabpot added a commit that referenced this pull request Oct 14, 2012
This PR was merged into the master branch.

Commits
-------

b31ae34 [WebProfilerBundle] Remove the now unneeded BC var and fixed a typo
d07ce03 [TwigBundle] Moved the registration of the app global to the environment

Discussion
----------

[TwigBundle] Moved the registration of the app global to the environment

This makes the app global variable available also when accessing the Twig
environment directly instead of using the TwigEngine.
@fabpot fabpot merged commit b31ae34 into symfony:master Oct 14, 2012
@stof stof deleted the twig_global branch April 8, 2014 22:49
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
This PR was merged into the master branch.

Commits
-------

b31ae34 [WebProfilerBundle] Remove the now unneeded BC var and fixed a typo
d07ce03 [TwigBundle] Moved the registration of the app global to the environment

Discussion
----------

[TwigBundle] Moved the registration of the app global to the environment

This makes the app global variable available also when accessing the Twig
environment directly instead of using the TwigEngine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants