Skip to content

Commit

Permalink
feature #14052 [FrameworkBundle] added a protected shortcut getParame…
Browse files Browse the repository at this point in the history
…ter() 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.
  • Loading branch information
fabpot committed Apr 2, 2015
2 parents 96d83a7 + 5d96f4d commit 4b19daf
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Expand Up @@ -334,7 +334,7 @@ public function has($id)
}

/**
* Gets a service by id.
* Gets a container service by its id.
*
* @param string $id The service id
*
Expand All @@ -345,10 +345,22 @@ public function get($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);
}

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
*
Expand Down

0 comments on commit 4b19daf

Please sign in to comment.