<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
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.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: 14)
Table of Contents
1. Overview
2. References
zone: Missing {zone-data:requirements}
zone: Missing {zone-data:dependencies}
zone: Missing {zone-data:operation}
zone: Missing {zone-data:milestones}
zone: Missing {zone-data:class-list}
zone: Missing {zone-data:use-cases}
zone: Missing {zone-data:skeletons}
]]></ac:plain-text-body></ac:macro>]]></ac:plain-text-body></ac:macro>
Labels:
None
2 Comments
comments.show.hideJul 22, 2006
Mike Borozdin
<p>I found a solution <a class="external-link" href="http://www.sitepoint.com/forums/showthread.php?t=404478">http://www.sitepoint.com/forums/showthread.php?t=404478</a>, just need to test it.</p>
Jan 22, 2007
Darby Felton
<ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Comments</ac:parameter><ac:rich-text-body>
<p>The functionality implied by the described use cases is supported through the use of <a href="http://framework.zend.com/manual/en/zend.controller.plugins.html">controller plugins</a>.</p></ac:rich-text-body></ac:macro>