Skip to content

Commit

Permalink
reduce str_replace in View/Parser::render()
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Aug 11, 2018
1 parent e07e8ff commit bed26b2
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,13 @@ public function render(string $view, array $options = null, $saveData = null): s
$saveData = $this->config->saveData;
}

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

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

if ($output = cache($cacheName))
{
Expand Down

0 comments on commit bed26b2

Please sign in to comment.