8000 [WebProfilerBundle] Made is_ajax available to the view when rendering… · symfony/symfony@ed028d5 · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}

Commit ed028d5

Browse files
committed
[WebProfilerBundle] Made is_ajax available to the view when rendering panels
1 parent b80951c commit ed028d5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpFoundation\RedirectResponse;
1717
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1818
use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag;
19+
use Symfony\Component\HttpFoundation\Request;
1920

2021
/**
2122
* ProfilerController.
@@ -27,11 +28,12 @@ class ProfilerController extends ContainerAware
2728
/**
2829
* Renders a profiler panel for the given token.
2930
*
30-
* @param string $token The profiler token
31+
* @param Request $request The HTTP request
32+
* @param string $token The profiler token
3133
*
3234
* @return Response A Response instance
3335
*/
34-
public function panelAction($token)
36+
public function panelAction(Request $request, $token)
3537
{
3638
$profiler = $this->container->get('profiler');
3739
$profiler->disable();
@@ -54,6 +56,7 @@ public function panelAction($token)
5456
'panel' => $panel,
5557
'page' => $page,
5658
'templates' => $this->getTemplates($profiler),
59+
'is_ajax' => $request->isXmlHttpRequest(),
5760
));
5861
}
5962

0 commit comments

Comments
 (0)
0