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:
parent
a192a42de5
commit
37dfe0e6ef
1 changed files with 1 additions and 8 deletions
|
@ -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…
Reference in a new issue