Skip to content

Commit c8eae69

Browse files
authored
Replace Controller with AbstractController
As of Symfony 4.2 Controller is depreciated in favor of 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,
1 parent 2234bd3 commit c8eae69

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)