From 5d96f4dbd73efcc15205472f2871c903a6b37e5a Mon Sep 17 00:00:00 2001 From: Hugo Hamon Date: Wed, 25 Mar 2015 11:05:20 +0100 Subject: [PATCH] =?UTF-8?q?[FrameworkBundle]=C2=A0added=20a=20protected=20?= =?UTF-8?q?shortcut=20getParameter()=20method=20in=20the=20base=20Controll?= =?UTF-8?q?er=20class.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FrameworkBundle/Controller/Controller.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php index 0df7823675..b78d475927 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php @@ -334,7 +334,7 @@ class Controller extends ContainerAware } /** - * Gets a service by id. + * Gets a container service by its id. * * @param string $id The service id * @@ -345,10 +345,22 @@ class Controller extends ContainerAware if ('request' === $id) { trigger_error('The "request" service is deprecated and will be removed in 3.0. Add a typehint for Symfony\\Component\\HttpFoundation\\Request to your controller parameters to retrieve the request instead.', E_USER_DEPRECATED); } - + return $this->container->get($id); } + /** + * Gets a container configuration parameter by its name. + * + * @param string $name The parameter name + * + * @return mixed + */ + protected function getParameter($name) + { + return $this->container->getParameter($name); + } + /** * Checks the validity of a CSRF token *