prehfeldt
prehfeldt

Reputation: 2182

Symfony2 Event that gets fired after service creation but before the controller

Is there an event that gets fired after my custom services are created but before the controller action is called?

And is there a full list of all events in Symfony2?

Upvotes: 2

Views: 1109

Answers (2)

HappyDeveloper
HappyDeveloper

Reputation: 12805

Here you have a list of events, though I'm not sure if it is complete:

http://symfony.com/doc/current/book/internals.html#events

Upvotes: 2

igorw
igorw

Reputation: 28239

One of the nice things about the DIC (Dependency Injection Container) is that the services are only created when you actually need them. This means that most services will be invoked and thus created from within the controller.

To answer your question, there is the kernel.request event that is fired before the controller, so you can use that.

Upvotes: 5

Related Questions