feature #14052 [FrameworkBundle] added a protected shortcut getParameter() method in the base Controller class. (hhamon)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] added a protected shortcut getParameter() method in the base Controller class.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

5d96f4d [FrameworkBundle] added a protected shortcut getParameter() method in the base Controller class.
This commit is contained in:
Fabien Potencier 2015-04-02 15:28:00 +02:00
commit 4b19daf1b0

View File

@ -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
*