mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进默认模板引擎的设置 如果没有设置 template.type 或者为空 默认为think
This commit is contained in:
@@ -40,14 +40,15 @@ class View
|
|||||||
// 视图驱动命名空间
|
// 视图驱动命名空间
|
||||||
'namespace' => '\\think\\view\\driver\\',
|
'namespace' => '\\think\\view\\driver\\',
|
||||||
// 模板引擎配置参数
|
// 模板引擎配置参数
|
||||||
'template' => [
|
'template' => [],
|
||||||
'type' => 'think',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct(array $config = [])
|
public function __construct(array $config = [])
|
||||||
{
|
{
|
||||||
$this->config($config);
|
$this->config($config);
|
||||||
|
if (!isset($this->config['template']['type'])) {
|
||||||
|
$this->config['template']['type'] = 'think';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,6 +123,7 @@ class View
|
|||||||
if (empty($this->config['view_path']) && defined('VIEW_PATH')) {
|
if (empty($this->config['view_path']) && defined('VIEW_PATH')) {
|
||||||
$this->config['view_path'] = VIEW_PATH;
|
$this->config['view_path'] = VIEW_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = array_merge($config, [
|
$config = array_merge($config, [
|
||||||
'view_path' => $this->config['view_path'],
|
'view_path' => $this->config['view_path'],
|
||||||
'view_suffix' => $this->config['view_suffix'],
|
'view_suffix' => $this->config['view_suffix'],
|
||||||
|
|||||||
Reference in New Issue
Block a user