Beispiel #1
0
 /**
  * Initialize the class instance variables and then call the action.
  *
  * @param Zend_Controller_Dispatcher_Token $action
  */
 public final function run(Zend_Controller_Dispatcher_Interface $dispatcher, Zend_Controller_Dispatcher_Token $action)
 {
     $this->_action = $action;
     $this->_params = $action->getParams();
     if (!strlen($action->getActionName())) {
         $action->setActionName('index');
     }
     $methodName = $dispatcher->formatActionName($action->getActionName());
     if (!method_exists($this, $methodName)) {
         $this->__call($methodName, array());
     } else {
         $method = new ReflectionMethod($this, $methodName);
         if ($method->isPublic() && !$method->isStatic()) {
             $this->{$methodName}();
         } else {
             throw new Zend_Controller_Page_Exception('Illegal action called.');
         }
     }
     $nextAction = $this->_nextAction;
     $this->_nextAction = null;
     return $nextAction;
 }