예제 #1
0
 public function call($component = null, $controller = null, $action = null)
 {
     if (is_null($component) && is_null($controller) && is_null($action)) {
         throw new \LogicException('Action calling the same action, circular calls detected.');
     }
     if (is_null($component)) {
         $component = $this->getComponentNamespace();
     }
     if (is_null($controller)) {
         $controller = $this->getControllerClass();
     }
     if (is_null($action)) {
         $action = 'index';
     }
     $dispatcher = new Dispatcher();
     return $dispatcher->dispatch($component, $controller, $action);
 }
예제 #2
0
 public function execute($component, $controller, $action)
 {
     $dispatcher = new Dispatcher($component, $controller, $action);
     echo $dispatcher->dispatch();
 }