Zend Framework: Intercepting Filters Component Proposal
| Proposed Component Name | Intercepting Filters |
|---|---|
| Developer Notes | http://framework.zend.com/wiki/display/ZFDEV/Intercepting Filters |
| Proposers | Mike Borozdin, author Darby Felton, Zend liaison |
| Revision | 1.1 - 18 July 2006: Some thoughts of mine. (wiki revision: 13) |
Table of Contents
1. Overview
Zend Framework lacks of intercepting filters that should be executed before a specified controllers or actions in order to make some validations, for example, check whether user is authenticated if not then redirect to a login page, the code can look something like this
For instance, we have PagesController that has four actions: viewAction(), addAction(), editAction(), removeAction(), the last three actions can be performed by autenticates users only, so we must check. Sure, we can put this logic to the action method or write Authenticated_Controller_Action, but what if we have to make some other validations.
Zend Framework has a plugin mechanism that is not documented now, I tried to make a plugin that extends Zend_Controller_Plugin_Abstract but it lacks of interaction with controllers and action, besides it can't stop the routing process.
If you have any ideas, please comment or e-mail me.
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
5. Theory of Operation
6. Milestones / Tasks
7. Class Index
8. Use Cases
9. Class Skeletons
| Zend Comments The functionality implied by the described use cases is supported through the use of controller plugins. |
ZF Home Page
Code Browser
Wiki Dashboard
I found a solution http://www.sitepoint.com/forums/showthread.php?t=404478, just need to test it.