Skip to content

Commit

Permalink
Merge pull request #1704 from bangbangda/Fixes-1701
Browse files Browse the repository at this point in the history
Fix viewsDirectory bug Fixes #1701
  • Loading branch information
lonnieezell authored Feb 6, 2019
2 parents 4f4a37f + 5a87602 commit 3709388
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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));
}

Expand Down
4 changes: 3 additions & 1 deletion system/Debug/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*/

use CodeIgniter\API\ResponseTrait;
use Config\Paths;

/**
* Exceptions manager
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 3709388

Please sign in to comment.