Exemplo n.º 1
0
 /**
  * call a controller and/or an action
  * @param string $controllerType
  * @param string $action
  * @return string
  */
 public function doExecute($controllerType, $action)
 {
     //if controllerType or action changed, update the app
     if ($controllerType != $this->getAppController()) {
         $this->app->setController($controllerType);
     }
     if ($action != $this->getAppControllerAction()) {
         $this->app->setAction($action);
     }
     // get controller
     $this->controller = $this->getController($controllerType);
     $this->controller->setCallObserver($this);
     // handle controller action if given
     if ($this->controller instanceof Vmvc_ActionController) {
         $this->executeControllerAction($action);
     }
     // execute controller
     $status = $this->executeController();
     // render view
     // TODO refactor this, should be done in the ApplicationController
     if ($this->viewScriptPath === null) {
         $this->viewScriptPath = $this->getAppViewScript($status);
     }
     return $this->viewScriptPath;
 }