Skip to content

Commit b42009b

Browse files
committed
改进指定文件渲染输出
1 parent e6a68e4 commit b42009b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Think.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,12 @@ protected function getTemplateFile(string $template): string
9898
if ('' == pathinfo($template, PATHINFO_EXTENSION)) {
9999
// 获取模板文件名
100100
$template = $this->parseTemplate($template);
101-
} elseif (!is_file($template)) {
102-
$path = $this->config['view_path'] ?: $this->getViewPath($this->app->http->getName());
103-
$template = $path . $template;
101+
} else{
102+
$path = $this->config['view_path'] ?: $this->getViewPath($this->app->http->getName());
103+
if (!is_file($template)) {
104+
$template = $path . $template;
105+
}
106+
$this->template->view_path = $path;
104107
}
105108

106109
return $template;

0 commit comments

Comments
 (0)