Symfony 3.3.3 - default controller and container

I downloaded the latest stable version of Symfony (3.3.3), and on startup I have an error:

Attempted to call an undefined method named "getParameter" of class "AppBundle\Controller\DefaultController".

It:

'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,

Prior to version 3.3.3, extended Symfony controllers

Symfony \ Bundle \ FrameworkBundle \ Controller \ Controller.php

Now proceeds:

Symfony \ Bundle \ FrameworkBundle \ Controller \ AbstractController \ AbstractController.php

So ... How can I get data from the container? In the documentation (versions 3.3 and 4.0), the controller extends Controller, not AbstractController.

If I changed the AbstractController application to the Controller application, fine, but does it need to be changed?

+4
source share
3 answers

symfony, , Controller AbstractController - .

+2

3.3.4, . : http://symfony.com/blog/symfony-3-3-4-released , composer

composer update
+1

:   php symfony new project_name 3.3.2 .

-2

Source: https://habr.com/ru/post/1680714/


All Articles