-- Chris Hartjes <[EMAIL PROTECTED]> wrote
(on Tuesday, 14 November 2006, 09:16 AM -0500):
> On 11/13/06, Mauro Casula <[EMAIL PROTECTED]> wrote:
> > I need your help. I need to know how can i now what
> > Zend_Controller_Dispatcher_Token i'm going to dispatch in my Index.php.
> >
> > I need to know this because i'm developing an authentication system that
> > will make the following:
> > $controller = Zend_Controller_Front::getInstance();
> > //AuthenticationController is my authentication class
> > $auth = AuthenticationController::factory($db,$session,$controller);
> >
> > // if i have to authenticate:
> 
> I'm not sure if ZF has this yet, but wouldn't some sort of
> beforeFilter method that gets executed before each action in the
> controller handle authentication issues?
> 
> CakePHP has this type of thing, I just don't know if ZF does.

In versions <= 0.1.5, you could attach a
Zend_Controller_Plugin_Interface derived class to the front controller,
and override the preDispatch() method to do so.

In the incubator version of the controller classes introduced in 0.2.0,
you still have that, but also have a preDispatch() method in the action
controller itself that gets called prior to the actual action method.

I've detailed this previously in this thread.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to