Is there a Symfony 2 controller beforeAction?

Is there a way, for example, beforeAction for Symfony 2 controllers? Also, is there a common beforeAction for the whole package / project?

+4
source share
1 answer

No, unfortunately, symfony2 does not have the equivalent of preExecute , but instead you have access to a more powerful event model.

This article explains how to add a listener.

The event you want to listen to is onCoreController

See also: http://symfony.com/doc/2.0/book/internals.html#the-event-dispatcher

+8
source

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


All Articles