SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Zend Framework. Anyone?

    I downloaded 0.15 version and currently playing with it. I'm wondering if anybody is doing it as well. I got in stuck with creating an intercepting filter. Controllers can have some kind of plugins that get notified about the dispatching process, but they can't stop that process, for example, to redirect an unanthenticated user, they even can't get the name of a dispatched command and action. I might be wrong though, plugin are not yet documenented.

    I wrote my thoughts here as well: http://framework.zend.com/wiki/displ...epting+filters

  2. #2
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can get the name of the controller and action through the $token.

    when i implemented authentication i wrote this code.

    PHP Code:
        function preDispatch($token)
        {
            
    $param = array('origToken'=>array($token));

            switch (
    $key $this->actionAllowed($token)) {
                case 
    'login':
                    return new 
    Zend_Controller_Dispatcher_Token('community''login'$param);
                    break;
                case 
    'noAccess':
                    return new 
    Zend_Controller_Dispatcher_Token($token->getControllerName(), 'noAccess'$param);
                    break;
                default:
                    return 
    $token;
                    break;
            }
        } 
    hope it clear things up.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •