jeremib
jeremib

Reputation: 751

Code ran before every action within symfony

I have code that I want to be executed before every action is called. Are there action hooks I can use for this?

Upvotes: 2

Views: 627

Answers (2)

Darragh Enright
Darragh Enright

Reputation: 14136

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

Upvotes: 1

Amy B
Amy B

Reputation: 17977

In a module:

public function preExecute()
{

}

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

Upvotes: 6

Related Questions