Skip to content

Commit

Permalink
bumped min version of Twig to 1.28
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Nov 12, 2016
1 parent 4967ad4 commit b8f7614
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 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/Bridge/Twig/composer.json
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": ">=5.3.9",
"twig/twig": "~1.27|~2.0"
"twig/twig": "~1.28|~2.0"
},
"require-dev": {
"symfony/asset": "~2.7",
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 b8f7614

Please sign in to comment.