diff --git a/system/Config/Services.php b/system/Config/Services.php index adbc19ce0b36..2df971482a31 100644 --- a/system/Config/Services.php +++ b/system/Config/Services.php @@ -434,7 +434,7 @@ public static function pager($config = null, RendererInterface $view = null, boo * * @return \CodeIgniter\View\Parser */ - public static function parser($viewPath = APPPATH . 'Views/', $config = null, bool $getShared = true) + public static function parser($viewPath = null, $config = null, bool $getShared = true) { if ($getShared) { @@ -446,6 +446,12 @@ public static function parser($viewPath = APPPATH . 'Views/', $config = null, bo $config = new \Config\View(); } + if (is_null($viewPath)) + { + $paths = config('Paths'); + $viewPath = $paths->viewDirectory; + } + return new \CodeIgniter\View\Parser($config, $viewPath, static::locator(true), CI_DEBUG, static::logger(true)); } diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php index 0ea00b6fccee..7942357616ab 100644 --- a/system/Debug/Exceptions.php +++ b/system/Debug/Exceptions.php @@ -37,6 +37,7 @@ */ use CodeIgniter\API\ResponseTrait; +use Config\Paths; /** * Exceptions manager @@ -259,7 +260,8 @@ protected function render(\Throwable $exception, int $statusCode) $path = $this->viewPath; if (empty($path)) { - $path = APPPATH . 'Views/errors/'; + $paths = new Paths(); + $path = $paths->viewDirectory . '/errors/'; } $path = is_cli()