From af88d81d9a2eb34c2f98686ceed9e9c90898c4cd Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Thu, 31 Aug 2017 17:49:55 +0200 Subject: [PATCH] do not require the templating component (#456) --- Controller/PanelController.php | 21 +++++++++------------ Resources/config/propel.xml | 2 +- Resources/views/Collector/propel.html.twig | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Controller/PanelController.php b/Controller/PanelController.php index 08b6b07..b78b2a0 100644 --- a/Controller/PanelController.php +++ b/Controller/PanelController.php @@ -11,6 +11,7 @@ namespace Propel\Bundle\PropelBundle\Controller; use Propel\Runtime\Propel; +use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\Response; @@ -20,23 +21,19 @@ use Symfony\Component\HttpFoundation\Response; * * @author William DURAND */ -class PanelController implements ContainerAwareInterface +class PanelController extends Controller { - use ContainerAwareTrait; - /** * This method renders the global Propel configuration. */ public function configurationAction() { - $templating = $this->container->get('templating'); - - return $templating->renderResponse( - 'PropelBundle:Panel:configuration.html.twig', + return $this->render( + '@Propel/Panel/configuration.html.twig', array( 'propel_version' => Propel::VERSION, - 'configuration' => $this->container->getParameter('propel.configuration'), - 'logging' => $this->container->getParameter('propel.logging'), + 'configuration' => $this->getParameter('propel.configuration'), + 'logging' => $this->getParameter('propel.logging'), ) ); } @@ -52,7 +49,7 @@ class PanelController implements ContainerAwareInterface */ public function explainAction($token, $connection, $query) { - $profiler = $this->container->get('profiler'); + $profiler = $this->get('profiler'); $profiler->disable(); $profile = $profiler->loadProfile($token); @@ -73,8 +70,8 @@ class PanelController implements ContainerAwareInterface return new Response('
This query cannot be explained.
'); } - return $this->container->get('templating')->renderResponse( - 'PropelBundle:Panel:explain.html.twig', + return $this->render( + '@Propel/Panel/explain.html.twig', array( 'data' => $results, 'query' => $query, diff --git a/Resources/config/propel.xml b/Resources/config/propel.xml index 383671b..8c70031 100644 --- a/Resources/config/propel.xml +++ b/Resources/config/propel.xml @@ -32,7 +32,7 @@ - + diff --git a/Resources/views/Collector/propel.html.twig b/Resources/views/Collector/propel.html.twig index c94915b..e3287db 100644 --- a/Resources/views/Collector/propel.html.twig +++ b/Resources/views/Collector/propel.html.twig @@ -1,4 +1,4 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} +{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {# the web debug toolbar content #}