From c8eae6949b012c613f8d500cbf74582ea943599e Mon Sep 17 00:00:00 2001 From: Krzysztof Daniel Date: Mon, 18 Feb 2019 21:16:40 +0100 Subject: [PATCH] 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, --- service_container.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service_container.rst b/service_container.rst index bf3c06d683c..30497ca1ea3 100644 --- a/service_container.rst +++ b/service_container.rst @@ -534,8 +534,8 @@ You can also fetch parameters directly from the container:: { // ... - // this ONLY works if you extend the base Controller - $adminEmail = $this->container->getParameter('admin_email'); + // this ONLY works if you extend the base AbstractController + $adminEmail = $this->container->get('parameter_bag')->get('admin_email'); // or a shorter way! // $adminEmail = $this->getParameter('admin_email');