private function processDefaultRequestUri($uri, $postData)
 {
     $uriParts = explode('/', trim($uri, ' '));
     if (count($uriParts) < 3) {
         throw new \Exception('No valid route found', 404);
     }
     $area = ucfirst($uriParts[0]);
     $controller = ucfirst($uriParts[1]);
     $action = $uriParts[2];
     $params = array_slice($uriParts, 3);
     $fullControllerName = DirectoryHelper::getControllerPath($area, $controller);
     if (!isset($this->getAppStructure()[$area][$fullControllerName][$action])) {
         throw new \Exception('No valid route found', 404);
     }
     $this->setAreaName($area);
     $this->setControllerName(ucfirst($controller));
     $this->setActionName($action);
     $this->setRequestParams($params);
     if (!$this->validatePostData($postData)) {
         throw new \Exception('Invalid data supplied');
     }
     return new RequestUriResult($this->getAreaName(), $this->getControllerName(), $this->getActionName(), $this->getRequestParams());
 }
 private function validateRouteUri($areaName, $fullControllerName, $actionName)
 {
     if (!isset($this->getAppStructure()[$areaName])) {
         throw new \Exception("Area: {$areaName} not found.");
     }
     if (!isset($this->getAppStructure()[$areaName][$fullControllerName])) {
         throw new \Exception("Controller: {$fullControllerName} not found");
     }
     if (!isset($this->getAppStructure()[$areaName][$fullControllerName][$actionName])) {
         throw new \Exception("Controller: {$fullControllerName} contains no method: {$actionName}");
     }
     $controller = DirectoryHelper::getControllerName($fullControllerName);
     $area = strtolower($areaName);
     $route = "{$area}/{$controller}/{$actionName}";
     return $route;
 }
 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);
 }