コード例 #1
0
 public function forward(Zorg_Request $request)
 {
     if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR . $request->getController() . '.php')) {
         $class = $request->getController() . '_Controller';
         $method = $request->getAction() . 'Action';
         if (method_exists($class, $method)) {
             $ctrl = new $class($request);
             $ctrl->{$method}();
         } else {
             throw new Zorg_Dispatcher_Exception('Action ' . $request->getAction() . ' doesn\'t exists in controller ' . $request->getController());
         }
     } else {
         // Controller file doesn't exists
         throw new Zorg_Dispatcher_Exception('Controller ' . $request->getController() . ' doesn\'t exists.');
     }
 }
コード例 #2
0
 public function __construct(Zorg_Request $request)
 {
     $this->_request = $request;
     $this->_response = new Zorg_Response();
     $this->_view = new Zorg_View($this->_request->getController(), $this->_request->getAction());
 }