开发者

How to create a pre-dispatch in symfony, which gets called before any module/action?

As the title says, I'm basically trying to create a pre-dispatch, similar to how it works in Zend, but I need it done in Symfony.

For example - if someone navigates to a certain module/action, it would run my pre-dispatch first before doing that, and do the same for any module/action.

Would I need to create a plugin for this? Or is this something that I can setup some other way. Unfortunately I didn't find much information about it in the official documentation, so I thought I'd ask on h开发者_StackOverflowere.


you can use a filter. I didn't find any documentation for this in sf 1.4 documentation, all there is is a documentation regarding the filters.yml file. Anyway, it works with sf1.4, no problem.


In Symfony2 you should do something like this, because the preExecute method is not available there: How to create a something like Zend preDispatch method in Symfony2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜