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
@ -1991,14 +1991,7 @@ class Pico
|
|||||||
protected function getTwigTemplate()
|
protected function getTwigTemplate()
|
||||||
{
|
{
|
||||||
$templateName = !empty($this->meta['template']) ? $this->meta['template'] : 'index';
|
$templateName = !empty($this->meta['template']) ? $this->meta['template'] : 'index';
|
||||||
|
return $templateName . '.twig';
|
||||||
if (file_exists($this->getThemesDir() . $this->getConfig('theme') . '/' . $templateName . '.twig')) {
|
|
||||||
$templateName .= '.twig';
|
|
||||||
} else {
|
|
||||||
$templateName .= '.html';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $templateName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user