public function SaveFile(\Puzzlout\Framework\Controllers\BaseController $controller)
 {
     $result = JsonResult::Init()->SetDefault();
     if (count($controller->dataPost()) === 0) {
         throw new Exception("dataPost is empty! Please the form submission", 0, null);
     }
     $newFile = NewFileItem::Init()->Fill($controller->dataPost());
     $result->UpdateResult(JsonResult::STATE_SUCCESS, $newFile);
     return $result;
 }
 /**
  * Computes the path of the view.
  * 
  * @param string $rootDir
  * @see \Puzzlout\Framework\Core\ViewLoader::GetFrameworkRootDir()
  * @see \Puzzlout\Framework\Core\ViewLoader::GetApplicationRootDir()
  * @return string The directory where to find the view.
  */
 public function GetPathForView($rootDir)
 {
     $path = "APP_ROOT_DIR" . $rootDir . ucfirst($this->controller->module()) . "/" . ucfirst($this->controller->action()) . self::VIEWFILEEXTENSION;
     return $path;
 }