Force themes to use .twig as file extension

We recommend plugin developers to use templates when serving HTML contents (like the UI of PicoAdmin), however, by supporting multiple file extensions for themes, we make it pretty hard to overwrite a plugin's template with a theme. As always, we preserve BC using PicoDeprecated.
pico-3.0-alpha
Daniel Rudolf 8 years ago
parent a192a42de5
commit 37dfe0e6ef
No known key found for this signature in database
GPG Key ID: A061F02CD8DE4538
  1. 9
      lib/Pico.php

@ -1991,14 +1991,7 @@ class Pico
protected function getTwigTemplate()
{
$templateName = !empty($this->meta['template']) ? $this->meta['template'] : 'index';
if (file_exists($this->getThemesDir() . $this->getConfig('theme') . '/' . $templateName . '.twig')) {
$templateName .= '.twig';
} else {
$templateName .= '.html';
}
return $templateName;
return $templateName . '.twig';
}
/**

Loading…
Cancel
Save