Skip to content

Commit

Permalink
Merge pull request #1159 from samsonasik/reduce-str-replace-parser
Browse files Browse the repository at this point in the history
reduce str_replace in View/Parser::render()
  • Loading branch information
lonnieezell authored Aug 13, 2018
2 parents 20d5d02 + b10ddb0 commit 5c0ce8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions system/View/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ public function render(string $view, array $options = null, $saveData = null): s
$saveData = $this->config->saveData;
}

$view = str_replace('.php', '', $view) . '.php';
$view = str_replace('.php', '', $view);

// Was it cached?
if (isset($options['cache']))
{
$cacheName = $options['cache_name'] ?: str_replace('.php', '', $view);
$cacheName = $options['cache_name'] ?: $view;

if ($output = cache($cacheName))
{
Expand All @@ -143,6 +143,7 @@ public function render(string $view, array $options = null, $saveData = null): s
}
}

$view = $view . '.php';
$file = $this->viewPath . $view;

if ( ! file_exists($file))
Expand Down

0 comments on commit 5c0ce8a

Please sign in to comment.