diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/DefaultController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/DefaultController.php index d68861e40a95..09f0ba647aab 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/DefaultController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/DefaultController.php @@ -2,8 +2,8 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\DependencyInjection\ContainerAware; /* * This file is part of the Symfony framework. @@ -19,7 +19,7 @@ * * @author Fabien Potencier */ -class DefaultController extends Controller +class DefaultController extends ContainerAware { /** * Renders the Symfony2 welcome page. @@ -28,6 +28,6 @@ class DefaultController extends Controller */ public function indexAction() { - return $this['templating']->renderResponse('FrameworkBundle:Default:index'); + return $this->container->get('templating')->renderResponse('FrameworkBundle:Default:index'); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php index 270072b0c06f..bced69e3fd8f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\OutputEscaper\SafeDecorator; @@ -21,7 +21,7 @@ * * @author Fabien Potencier */ -class ExceptionController extends Controller +class ExceptionController extends ContainerAware { /** * Converts an Exception to a Response. @@ -35,15 +35,15 @@ class ExceptionController extends Controller */ public function exceptionAction(FlattenException $exception, DebugLoggerInterface $logger = null, $format = 'html', $embedded = false) { - $this['request']->setRequestFormat($format); + $this->container->get('request')->setRequestFormat($format); $currentContent = ''; while (false !== $content = ob_get_clean()) { $currentContent .= $content; } - $response = $this->render( - 'FrameworkBundle:Exception:'.($this['kernel']->isDebug() ? 'exception' : 'error'), + $response = $this->container->get('templating')->renderResponse( + 'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception' : 'error'), array( 'exception' => new SafeDecorator($exception), 'logger' => $logger, diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php index d18ba7bab773..ca585ba638c4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\HttpFoundation\Response; /* @@ -19,7 +19,7 @@ * * @author Fabien Potencier */ -class InternalController extends Controller +class InternalController extends ContainerAware { /** * Forwards to the given controller with the given path. @@ -31,7 +31,7 @@ class InternalController extends Controller */ public function indexAction($path, $controller) { - $request = $this['request']; + $request = $this->container->get('request'); $attributes = $request->attributes; $attributes->delete('path'); @@ -42,6 +42,6 @@ public function indexAction($path, $controller) $attributes->add($tmp); } - return $this['controller_resolver']->forward($controller, $attributes->all(), $request->query->all()); + return $this->container->get('controller_resolver')->forward($controller, $attributes->all(), $request->query->all()); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php index e3462da8675b..33200b724134 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\HttpFoundation\Response; /* @@ -19,7 +19,7 @@ * * @author Fabien Potencier */ -class RedirectController extends Controller +class RedirectController extends ContainerAware { /** * Redirects to another route. @@ -38,7 +38,7 @@ class RedirectController extends Controller public function redirectAction($route, $permanent = false) { if (!$route) { - $response = $this['response']; + $response = $this->container->get('response'); $response->setStatusCode(410); return $response; @@ -46,10 +46,10 @@ public function redirectAction($route, $permanent = false) $code = $permanent ? 301 : 302; - $attributes = $this['request']->attributes->all(); + $attributes = $this->container->get('request')->attributes->all(); unset($attributes['_route'], $attributes['route']); - $response = $this['response']; + $response = $this->container->get('response'); $response->setRedirect($this['router']->generate($route, $attributes), $code); return $response; diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php index 7f5755c265a7..62249513edad 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\HttpFoundation\Response; /* @@ -19,7 +19,7 @@ * * @author Fabien Potencier */ -class TemplateController extends Controller +class TemplateController extends ContainerAware { /** * Renders a template. @@ -30,6 +30,6 @@ class TemplateController extends Controller */ public function templateAction($template) { - return $this['templating']->renderResponse($template); + return $this->container->get('templating')->renderResponse($template); } }