diff --git a/system/View/Parser.php b/system/View/Parser.php index 83f2eb25ff38..bfe20bfbfc12 100644 --- a/system/View/Parser.php +++ b/system/View/Parser.php @@ -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)) {