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.
This commit is contained in:
Daniel Rudolf 2017-11-25 21:52:03 +01:00
parent a192a42de5
commit 37dfe0e6ef
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -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';
}
/**