do not require the templating component (#456)

This commit is contained in:
Gregor Harlan 2017-08-31 17:49:55 +02:00 committed by Marc J. Schmidt
parent 4df8ff614c
commit af88d81d9a
3 changed files with 11 additions and 14 deletions

View file

@ -11,6 +11,7 @@
namespace Propel\Bundle\PropelBundle\Controller; namespace Propel\Bundle\PropelBundle\Controller;
use Propel\Runtime\Propel; use Propel\Runtime\Propel;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -20,23 +21,19 @@ use Symfony\Component\HttpFoundation\Response;
* *
* @author William DURAND <william.durand1@gmail.com> * @author William DURAND <william.durand1@gmail.com>
*/ */
class PanelController implements ContainerAwareInterface class PanelController extends Controller
{ {
use ContainerAwareTrait;
/** /**
* This method renders the global Propel configuration. * This method renders the global Propel configuration.
*/ */
public function configurationAction() public function configurationAction()
{ {
$templating = $this->container->get('templating'); return $this->render(
'@Propel/Panel/configuration.html.twig',
return $templating->renderResponse(
'PropelBundle:Panel:configuration.html.twig',
array( array(
'propel_version' => Propel::VERSION, 'propel_version' => Propel::VERSION,
'configuration' => $this->container->getParameter('propel.configuration'), 'configuration' => $this->getParameter('propel.configuration'),
'logging' => $this->container->getParameter('propel.logging'), 'logging' => $this->getParameter('propel.logging'),
) )
); );
} }
@ -52,7 +49,7 @@ class PanelController implements ContainerAwareInterface
*/ */
public function explainAction($token, $connection, $query) public function explainAction($token, $connection, $query)
{ {
$profiler = $this->container->get('profiler'); $profiler = $this->get('profiler');
$profiler->disable(); $profiler->disable();
$profile = $profiler->loadProfile($token); $profile = $profiler->loadProfile($token);
@ -73,8 +70,8 @@ class PanelController implements ContainerAwareInterface
return new Response('<div class="error">This query cannot be explained.</div>'); return new Response('<div class="error">This query cannot be explained.</div>');
} }
return $this->container->get('templating')->renderResponse( return $this->render(
'PropelBundle:Panel:explain.html.twig', '@Propel/Panel/explain.html.twig',
array( array(
'data' => $results, 'data' => $results,
'query' => $query, 'query' => $query,

View file

@ -32,7 +32,7 @@
<service id="propel.data_collector" class="%propel.data_collector.class%" public="false"> <service id="propel.data_collector" class="%propel.data_collector.class%" public="false">
<argument type="service" id="propel.logger" /> <argument type="service" id="propel.logger" />
<tag name="data_collector" template="PropelBundle:Collector:propel" id="propel" /> <tag name="data_collector" template="@Propel/Collector/propel" id="propel" />
</service> </service>
<service id="propel.twig.extension.syntax" class="%propel.twig.extension.syntax.class%"> <service id="propel.twig.extension.syntax" class="%propel.twig.extension.syntax.class%">

View file

@ -1,4 +1,4 @@
{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} {% extends '@WebProfiler/Profiler/layout.html.twig' %}
{% block toolbar %} {% block toolbar %}
{# the web debug toolbar content #} {# the web debug toolbar content #}