The code was executed before every action in symfony

I have some code that I want to execute before each action is called. Are there any actions I can use to do this?

+2


source to share


2 answers


In the module:

public function preExecute()
{

}

      



If you want it to be global for all modules, put it in the appConfiguration class or create a filter.

+6


source


+1 for filters. events can also be very helpful, depending on what you want to do.



+1


source







All Articles