Execute code before controller's action

后端 未结 3 502
傲寒
傲寒 2020-12-06 04:03

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 ?

3条回答
  •  温柔的废话
    2020-12-06 05:02

    You should especially read this documentation page: http://symfony.com/doc/current/cookbook/event_dispatcher/before_after_filters.html

提交回复
热议问题