mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进视图驱动类
This commit is contained in:
@@ -55,9 +55,12 @@ class Php
|
|||||||
*/
|
*/
|
||||||
public function fetch($template, $data = [])
|
public function fetch($template, $data = [])
|
||||||
{
|
{
|
||||||
|
if (!is_file($template)) {
|
||||||
|
// 获取模板文件名
|
||||||
|
$template = $this->parseTemplate($template);
|
||||||
|
}
|
||||||
// 模板不存在 抛出异常
|
// 模板不存在 抛出异常
|
||||||
$template = $this->exists($template);
|
if (!is_file($template)) {
|
||||||
if (!$template) {
|
|
||||||
throw new Exception('template file not exists:' . $template, 10700);
|
throw new Exception('template file not exists:' . $template, 10700);
|
||||||
}
|
}
|
||||||
// 记录视图信息
|
// 记录视图信息
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class Think
|
|||||||
// 获取模板文件名
|
// 获取模板文件名
|
||||||
$template = $this->parseTemplate($template);
|
$template = $this->parseTemplate($template);
|
||||||
}
|
}
|
||||||
return is_file($template) ? $template : false;
|
return is_file($template);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,9 +65,12 @@ class Think
|
|||||||
*/
|
*/
|
||||||
public function fetch($template, $data = [], $config = [])
|
public function fetch($template, $data = [], $config = [])
|
||||||
{
|
{
|
||||||
|
if (!is_file($template)) {
|
||||||
|
// 获取模板文件名
|
||||||
|
$template = $this->parseTemplate($template);
|
||||||
|
}
|
||||||
// 模板不存在 抛出异常
|
// 模板不存在 抛出异常
|
||||||
$template = $this->exists($template);
|
if (!is_file($template)) {
|
||||||
if (!$template) {
|
|
||||||
throw new Exception('template file not exists:' . $template, 10700);
|
throw new Exception('template file not exists:' . $template, 10700);
|
||||||
}
|
}
|
||||||
// 记录视图信息
|
// 记录视图信息
|
||||||
|
|||||||
Reference in New Issue
Block a user