private function initController($controllerName) { if (!isset($this->_uriParseResult->getAppStructure()[$this->_uriParseResult->getAreaName()][$controllerName][$this->_uriParseResult->getActionName()])) { throw new \Exception('Invalid controller or method name.'); } $this->_controller = new $controllerName($this->_uriParseResult->getAreaName(), $this->_uriParseResult->getControllerName(), $this->_uriParseResult->getActionName(), $this->_uriParseResult->getRequestParams()); }
public function __construct(RequestUriResult $requestParseResult, $view) { $this->_areaName = $requestParseResult->getAreaName(); $this->_controllerName = $requestParseResult->getControllerName(); $this->_actionName = $requestParseResult->getActionName(); $this->_requestParams = $requestParseResult->getRequestParams(); $this->_view = $view; $this->_databaseInstance = Database::getInstance(DatabaseConfig::DB_INSTANCE_NAME); }