G
G
grabbee2021-06-17 15:50:05
symfony
grabbee, 2021-06-17 15:50:05

Where does Symfony insert a container into Controllers?

interface ContainerAwareInterface implies a call to setContainer(ContainerInterface $container = null); - I can't find where in Symfony this happens. Found only RegisterControllerArgumentLocatorsPass where this method is simply ignored.

I want to do something similar to controllers. Based on the Interface and inheritance from an abstract class with additional functionality. As I understand it, I cannot add a constructor to an abstract class, since these classes will be automatically created. You can add services as a Setter, by type setContainer in AbstractController.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sl0, 2021-06-17
@grabbee

In vendor/symfony/framework-bundle/Controller/ControllerResolver.php
60cb6ed81b784282886223.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question