I would like execute code before all actions in my project (to calculate an important global variable). How to set a pre-action function in my controllers ?
You should especially read this documentation page: http://symfony.com/doc/current/cookbook/event_dispatcher/before_after_filters.html