[FrameworkBundle] added a protected shortcut getParameter() method in the base Controller class.
This commit is contained in:
parent
6ef12044f7
commit
5d96f4dbd7
@ -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
|
* @param string $id The service id
|
||||||
*
|
*
|
||||||
@ -345,10 +345,22 @@ class Controller extends ContainerAware
|
|||||||
if ('request' === $id) {
|
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);
|
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);
|
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
|
* Checks the validity of a CSRF token
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user