Skip to content

Commit

Permalink
[WebProfilerBundle] replaced usage of the render tag by the render fu…
Browse files Browse the repository at this point in the history
…nction (to decouple the bundle from TwigBundle)
  • Loading branch information
fabpot committed Dec 16, 2012
1 parent 0e2418c commit 00e08be
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
Expand Up @@ -166,11 +166,10 @@ public function infoAction($about)
*
* @param Request $request The current HTTP Request
* @param string $token The profiler token
* @param string $position The toolbar position (top, bottom, normal, or null -- use the configuration)
*
* @return Response A Response instance
*/
public function toolbarAction(Request $request, $token, $position = null)
public function toolbarAction(Request $request, $token)
{
$session = $request->getSession();

Expand All @@ -189,7 +188,8 @@ public function toolbarAction(Request $request, $token, $position = null)
return new Response();
}

if (null === $position) {
// the toolbar position (top, bottom, normal, or null -- use the configuration)
if (null === $position = $request->query->get('position')) {
$position = $this->toolbarPosition;
}

Expand Down
Expand Up @@ -8,6 +8,10 @@
<default key="_controller">web_profiler.controller.profiler:searchAction</default>
</route>

<route id="_profiler_search_bar" pattern="/search_bar">
<default key="_controller">web_profiler.controller.profiler:searchBarAction</default>
</route>

<route id="_profiler_purge" pattern="/purge">
<default key="_controller">web_profiler.controller.profiler:purgeAction</default>
</route>
Expand Down Expand Up @@ -36,6 +40,18 @@
<default key="_controller">web_profiler.controller.profiler:panelAction</default>
</route>

<route id="_profiler_router" pattern="/{token}/router">
<default key="_controller">web_profiler.controller.router:panelAction</default>
</route>

<route id="_profiler_exception" pattern="/{token}/exception">
<default key="_controller">web_profiler.controller.exception:showAction</default>
</route>

<route id="_profiler_exception_css" pattern="/{token}/exception.css">
<default key="_controller">web_profiler.controller.exception:cssAction</default>
</route>

<route id="_profiler_redirect" pattern="/">
<default key="_controller">FrameworkBundle:Redirect:redirect</default>
<default key="route">_profiler_search_results</default>
Expand Down
Expand Up @@ -2,7 +2,7 @@

{% block head %}
<style type="text/css">
{% render 'web_profiler.controller.exception:cssAction' with { 'token': token } %}
{{ render(path('_profiler_exception_css', { 'token': token })) }}
</style>
{{ parent() }}
{% endblock %}
Expand All @@ -28,7 +28,7 @@
</p>
{% else %}
<div class="sf-reset">
{% render 'web_profiler.controller.exception:showAction' with { 'token': token } %}
{{ render(path('_profiler_exception', { 'token': token })) }}
</div>
{% endif %}
{% endblock %}
Expand Up @@ -11,5 +11,5 @@
{% endblock %}

{% block panel %}
{% render "web_profiler.controller.router:panelAction" with {'token': token} %}
{{ render(path('_profiler_router', {'token': token})) }}
{% endblock %}
Expand Up @@ -34,7 +34,7 @@
</div>
</div>
<div id="navigation">
{% render 'web_profiler.controller.profiler:searchBarAction' %}
{{ render(path('_profiler_search_bar')) }}
{% include '@WebProfiler/Profiler/admin.html.twig' with { 'token': '' } only %}
</div>
</div>
Expand Down
Expand Up @@ -2,7 +2,7 @@

{% block body %}

{% render 'web_profiler.controller.profiler:toolbarAction' with { 'token': token, 'position': 'normal' } %}
{{ render(path('_wdt', { 'token': token, 'position': 'normal' })) }}

<div id="content">
{% include '@WebProfiler/Profiler/header.html.twig' only %}
Expand Down Expand Up @@ -53,7 +53,7 @@
</li>
</ul>
{% endif %}
{% render 'web_profiler.controller.profiler:searchBarAction' %}
{{ render(path('_profiler_search_bar')) }}
{% include '@WebProfiler/Profiler/admin.html.twig' with { 'token': token } only %}
</div>
</div>
Expand Down

0 comments on commit 00e08be

Please sign in to comment.