Symfony 2控制器是否有类似beforeAction
的方法?此外,是否有适用于整个捆绑包/项目的通用beforeAction
?
不,不幸的是,symfony2中没有等效的preExecute
,但您可以访问更强大的事件模型。
本文介绍了如何添加侦听器。
您要收听的事件是onCoreController
另请参阅:http://symfony.com/doc/2.0/book/internals.html#the-事件调度程序
Symfony 2控制器是否有类似beforeAction
的方法?此外,是否有适用于整个捆绑包/项目的通用beforeAction
?
不,不幸的是,symfony2中没有等效的preExecute
,但您可以访问更强大的事件模型。
本文介绍了如何添加侦听器。
您要收听的事件是onCoreController
另请参阅:http://symfony.com/doc/2.0/book/internals.html#the-事件调度程序