/** * Retrieve the partial view from either the Framework folder or the current Application folder. * * @param string $viewName The name of view to load * @throws \Puzzlout\Framework\Exceptions\ViewNotFoundException Throws an exception if the view is not found * @see \Puzzlout\Framework\Core\ViewLoader::GetFrameworkRootDir() * @see \Puzzlout\Framework\Core\ViewLoader::GetApplicationRootDir() */ public function GetPartialView($viewName) { $ListOfPathToCheck = array(DirectoryManager::GetFrameworkRootDir() . "Modules/", DirectoryManager::GetFrameworkRootDir() . $this->controller->module() . "/Modules/", DirectoryManager::GetApplicationRootDir() . "/Modules/", DirectoryManager::GetApplicationRootDir() . $this->controller->module() . "/Modules/"); foreach ($ListOfPathToCheck as $path) { $fileToCheck = $path . $viewName . self::VIEWFILEEXTENSION; if (file_exists($fileToCheck)) { return $fileToCheck; } } $errMsg = "Partial view \"" . $viewName . "\" not found in list." . var_dump($ListOfPathToCheck); throw new ViewNotFoundException($errMsg, MvcErrors::PARTIAL_VIEW_NOT_FOUND, null); }