Skip to content

Commit e7a61e2

Browse files
committed
Fix Template handling
1 parent 08ccf02 commit e7a61e2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

classes/Templating/Template.class.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,15 @@ public function resolveThemePath($file, $handler = false) : string {
114114
} else {
115115
$theme = sprintf('%1$s%2$sthemes%2$s%4$s%2$s%3$s.php', $this->path, DS, $file, $this->theme);
116116
}
117+
118+
if(!file_exists($theme)) {
119+
$theme = sprintf('%1$s%2$s%4$s%2$s%3$s.php', $this->path, DS, $file, $entry);
120+
}
117121

118122
if(!file_exists($theme)) {
119123
$theme = sprintf('%1$s%4$s%2$s%3$s.php', PATH, DS, $file, $entry);
120124
}
121-
125+
122126
return $theme;
123127
}
124128

@@ -152,7 +156,7 @@ public function assign(string $name, mixed $value) : void {
152156
public function display(string $file, array $arguments = [], bool $basedir = true, bool $once = true) : ?bool {
153157
$template = $this;
154158
$functions = $this->resolveThemePath('functions');
155-
159+
156160
if(file_exists($functions)) {
157161
if($once) {
158162
require_once($functions);
@@ -223,7 +227,7 @@ public function header() : void {
223227

224228
public function footer() : void {
225229
$template = $this;
226-
$path = $this->resolveThemePath('footer');
230+
$path = $this->resolveThemePath('footer');
227231

228232
foreach($this->assigns AS $name => $value) {
229233
${$name} = $value;

0 commit comments

Comments
 (0)