Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b19daf

Browse filesBrowse files
committed
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.
2 parents 96d83a7 + 5d96f4d commit 4b19daf
Copy full SHA for 4b19daf

File tree

Expand file treeCollapse file tree

1 file changed

+14
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-2
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
+14-2Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public function has($id)
334334
}
335335

336336
/**
337-
* Gets a service by id.
337+
* Gets a container service by its id.
338338
*
339339
* @param string $id The service id
340340
*
@@ -345,10 +345,22 @@ public function get($id)
345345
if ('request' === $id) {
346346
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);
347347
}
348-
348+
349349
return $this->container->get($id);
350350
}
351351

352+
/**
353+
* Gets a container configuration parameter by its name.
354+
*
355+
* @param string $name The parameter name
356+
*
357+
* @return mixed
358+
*/
359+
protected function getParameter($name)
360+
{
361+
return $this->container->getParameter($name);
362+
}
363+
352364
/**
353365
* Checks the validity of a CSRF token
354366
*

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.