We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30191db commit eeeed92Copy full SHA for eeeed92
service_container.rst
@@ -534,11 +534,11 @@ You can also fetch parameters directly from the container::
534
{
535
// ...
536
537
- // this ONLY works if you extend the base AbstractController
538
- $adminEmail = $this->container->get('parameter_bag')->get('admin_email');
+ // this shortcut ONLY works if you extend the base AbstractController
+ $adminEmail = $this->getParameter('admin_email');
539
540
- // or a shorter way!
541
- // $adminEmail = $this->getParameter('admin_email');
+ // this is the equivalent code of the previous shortcut:
+ // $adminEmail = $this->container->get('parameter_bag')->get('admin_email');
542
}
543
544
For more info about parameters, see :doc:`/service_container/parameters`.
0 commit comments