Zend Framework 2 FrontController Plugin

荒凉一梦 提交于 2019-12-02 08:44:06

Now you can do it in Events.

ZF2 have default events and you can attach your code(listeners) to particular event. List of all ZF2 default events.

You have to play around with ZF2 events/listeners to see what will be the best choice for you.

I am doing similar staff in MvcEvent::EVENT_ROUTE. Check current route, check current user permission and if user don't have permission just return different response.

There you can found great article about how to create event/listener "Understanding the Zend Framework 2 event manager".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!