Skip to content

Commit 30191db

Browse files
committed
minor #11011 Replace Controller with AbstractController (krisdante)
This PR was merged into the 4.2 branch. Discussion ---------- Replace Controller with AbstractController As of Symfony 4.2 Symfony\Bundle\FrameworkBundle\Controller\Controller is depreciated in favor of Symfony\Bundle\FrameworkBundle\Controller\AbstractController. To reflect this update I tweaked the section of getting parameter, as it slightly changed, and getParameter is no longer there on the container, <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- c8eae69 Replace Controller with AbstractController
2 parents 2234bd3 + c8eae69 commit 30191db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

service_container.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ You can also fetch parameters directly from the container::
534534
{
535535
// ...
536536

537-
// this ONLY works if you extend the base Controller
538-
$adminEmail = $this->container->getParameter('admin_email');
537+
// this ONLY works if you extend the base AbstractController
538+
$adminEmail = $this->container->get('parameter_bag')->get('admin_email');
539539

540540
// or a shorter way!
541541
// $adminEmail = $this->getParameter('admin_email');

0 commit comments

Comments
 (0)