Skip to content

Commit eeeed92

Browse files
committed
Minor reword
1 parent 30191db commit eeeed92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

service_container.rst

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

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

540-
// or a shorter way!
541-
// $adminEmail = $this->getParameter('admin_email');
540+
// this is the equivalent code of the previous shortcut:
541+
// $adminEmail = $this->container->get('parameter_bag')->get('admin_email');
542542
}
543543

544544
For more info about parameters, see :doc:`/service_container/parameters`.

0 commit comments

Comments
 (0)