_A_urlParts['controller'] = array_shift($_A_urlParts); $this->_A_urlParts['action'] = array_shift($_A_urlParts); $this->_A_urlParams = $_A_urlParts; $this->_A_postParams = $A_postParams; $this->_A_getParams = $A_getParams; } // Execute the controller and action deduced public function execute() { if (!class_exists($this->_A_urlParts['controller'])) { throw new ControllerException("Controller " . $this->_A_urlParts['controller'] . " is not valid."); } if (!method_exists($this->_A_urlParts['controller'], $this->_A_urlParts['action'])) { throw new ControllerException("Action " . $this->_A_urlParts['action'] . " of controller " . $this->_A_urlParts['controller'] . " is not valid."); } $called = call_user_func_array(array( new $this->_A_urlParts['controller'], $this->_A_urlParts['action']), array($this->_A_urlParams, $this->_A_postParams, $this->_A_getParams) ); if (false === $called) { throw new ControllerException("Action " . $this->_A_urlParts['action'] . " of controller " . $this->_A_urlParts['controller'] . " failed."); } if(Utils::RETURN_RAW === $called){ return Utils::RETURN_RAW; }else{ return Utils::RETURN_HTML; } } }