I have decided to rewrite an application that I wrote a long time ago in ZF1. A key part of this is the utilisation of a FrontController plugin that looks at a URL and if no matching route is found it will pass it on to another controller to process. The benefit of this is it worked for all modules without having to make further changes as it was registered as a plugin for the frontcontroller. Can someone please help as to how I could achieve the same in ZF2 Thanks in Adavance Adam
相关问题
- Why does recursive submodule update from github fa
- Zend Auth locked session
- Zend/PHP: Problem uploading/downloading file to/fr
- How to pass options/params to formCollection field
- PHP Zend Framework - Zend_Config and global state
相关文章
- Possible disadvantages of Zend [closed]
- Zend Framework Modules with common resources
- Zend Framework 2 Forms Array notation for drop dow
- Zend Form Validator Callback: How to exclude a use
- Exception while setting up the wurfl in zend
- How to create admin in Zend framework?
- zend framework and jquery - attach event from serv
- Magento: Programatically update cart via event
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".