Skip to content

Commit

Permalink
bug #20484 bumped min version of Twig to 1.28 (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.7 branch.

Discussion
----------

bumped min version of Twig to 1.28

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | see twigphp/Twig#2236
| License       | MIT
| Doc PR        | n/a

Commits
-------

b8f7614 bumped min version of Twig to 1.28
  • Loading branch information
fabpot committed Nov 16, 2016
2 parents a1afa21 + b8f7614 commit ef40651
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -21,7 +21,7 @@
"paragonie/random_compat": "~1.0",
"symfony/polyfill-apcu": "~1.1",
"symfony/polyfill-mbstring": "~1.1",
"twig/twig": "~1.27|~2.0",
"twig/twig": "~1.28|~2.0",
"psr/log": "~1.0"
},
"replace": {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/SecurityBundle/composer.json
Expand Up @@ -37,7 +37,7 @@
"symfony/yaml": "~2.0,>=2.0.5",
"symfony/expression-language": "~2.6",
"doctrine/doctrine-bundle": "~1.2",
"twig/twig": "~1.27|~2.0",
"twig/twig": "~1.28|~2.0",
"ircmaxell/password-compat": "~1.0"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/TwigBundle/composer.json
Expand Up @@ -19,7 +19,7 @@
"php": ">=5.3.9",
"symfony/asset": "~2.7",
"symfony/twig-bridge": "~2.7",
"twig/twig": "~1.27|~2.0",
"twig/twig": "~1.28|~2.0",
"symfony/http-foundation": "~2.5",
"symfony/http-kernel": "~2.7"
},
Expand Down
Expand Up @@ -106,7 +106,7 @@ public function panelAction(Request $request, $token)
'panel' => $panel,
'page' => $page,
'request' => $request,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'templates' => $this->getTemplateManager()->getNames($profile),
'is_ajax' => $request->isXmlHttpRequest(),
)), 200, array('Content-Type' => 'text/html'));
}
Expand Down Expand Up @@ -200,7 +200,7 @@ public function toolbarAction(Request $request, $token)
return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
'position' => $position,
'profile' => $profile,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'templates' => $this->getTemplateManager()->getNames($profile),
'profiler_url' => $url,
'token' => $token,
)), 200, array('Content-Type' => 'text/html'));
Expand Down
Expand Up @@ -67,7 +67,9 @@ public function getName(Profile $profile, $panel)
*
* @param Profile $profile
*
* @return array
* @return Twig_Template[]
*
* @deprecated not used anymore internally
*/
public function getTemplates(Profile $profile)
{
Expand All @@ -88,7 +90,7 @@ public function getTemplates(Profile $profile)
*
* @throws \UnexpectedValueException
*/
protected function getNames(Profile $profile)
public function getNames(Profile $profile)
{
$templates = array();

Expand Down
Expand Up @@ -36,7 +36,11 @@
{% if templates is defined %}
<ul id="menu-profiler">
{% for name, template in templates %}
{% set menu %}{{ template.renderBlock('menu', { 'collector': profile.getcollector(name)}) }}{% endset %}
{% set menu -%}
{% with { 'collector': profile.getcollector(name) } %}
{{ block('menu', template) }}
{% endwith %}
{%- endset %}
{% if menu != '' %}
<li class="{{ name }}{% if name == panel %} selected{% endif %}">
<a href="{{ path('_profiler', { 'token': token, 'panel': name }) }}">{{ menu|raw }}</a>
Expand Down
Expand Up @@ -26,13 +26,14 @@

<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset clear-fix" data-no-turbolink>
{% for name, template in templates %}
{{ template.renderblock('toolbar', {
{% with {
'collector': profile.getcollector(name),
'profiler_url': profiler_url,
'token': profile.token,
'name': name
})
}}
} %}
{{ block('toolbar', template) }}
{% endwith %}
{% endfor %}

{% if 'normal' != position %}
Expand Down

0 comments on commit ef40651

Please sign in to comment.