A
A
Alexey Verkhovtsev2018-09-12 09:17:20
symfony
Alexey Verkhovtsev, 2018-09-12 09:17:20

Similar to Laravel Service Provider for Symfony 4?

Hello everyone, is there an analogue of the Laravel Service Provider for Symfony 4, you need some place that will do some work when the framework is initialized and then it will be available to the entire project. I hope that I correctly described what I need. Thanks in advance

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2018-09-12
@OnYourLips

https://symfony.com/doc/current/event_dispatcher.html

V
voronkovich, 2018-09-12
@voronkovich

The direct analogue is container extension . For details see https://symfony.com/doc/current/components/depende...
The code for loading the extension should be placed in src/Kernel.php in the configureContainer method.

V
Victor Diditsky, 2018-09-12
@GhostSt92

If I understand you correctly, you are looking for - https://symfony.com/doc/current/service_container/...
This tool allows you to build services as you need when initializing the bundle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question