/** * Load action view */ public function __loadView() { if ($this->_renderView) { $controller = $this->request->getControllerName(); $action = null === $this->_useView ? $this->request->getActionName() : $this->_useView; // Load template from current view $this->view->loadView($action, $controller); } }
/** * Call controller action * * @param string $action Action name * @param string $controller Controller name * @param mixed $params Action params */ public function action($action, $controller, $params = []) { // Add given params into request $request = Request::load(); foreach ($params as $key => $value) { $request->setParam($key, $value); } // Route to new controller action $request->setIsInternal(); Router::load()->route($request->setUri(Config::get('base_path') . $controller . '/' . $action)); }
/** * Run Application */ public static function run() { // Set application config Config::init(); // Route to controller action Router::load()->route(Request::load()); }
/** * Do routing * * @param Request $request Request object */ public function route($request = null) { try { // Try loading route from uri $route = $this->_findeRoute($request->getUri()); // Try dispatching controller action $this->_dispatch($route, $request); } catch (Orc $e) { } }