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);
 }
 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());
 }
 private function initController(RequestUriResult $requestUriResult, View $view)
 {
     if (!$requestUriResult) {
         throw new \Exception('Url parse error');
     }
     $fullControllerName = DirectoryHelper::getControllerPath($requestUriResult->getAreaName(), $requestUriResult->getControllerName());
     $controller = new $fullControllerName($requestUriResult, $view);
     $this->setController($controller);
 }