mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
修正
This commit is contained in:
@@ -19,20 +19,20 @@ class View
|
|||||||
public $engine = null;
|
public $engine = null;
|
||||||
// 模板变量
|
// 模板变量
|
||||||
protected $data = [];
|
protected $data = [];
|
||||||
// 视图替换
|
// 视图输出替换
|
||||||
protected $replace = [];
|
protected $replace = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 架构函数
|
* 架构函数
|
||||||
* @access public
|
* @access public
|
||||||
* @param array $engine 模板引擎参数
|
* @param array $engine 模板引擎参数
|
||||||
|
* @param array $replace 字符串替换参数
|
||||||
*/
|
*/
|
||||||
public function __construct($engine = [])
|
public function __construct($engine = [], $replace = [])
|
||||||
{
|
{
|
||||||
// 初始化模板引擎
|
// 初始化模板引擎
|
||||||
if (!empty($engine)) {
|
$this->engine((array) $engine);
|
||||||
$this->engine($engine);
|
$this->replace = $replace;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +73,7 @@ class View
|
|||||||
* @param array $options 引擎参数
|
* @param array $options 引擎参数
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function engine(array $options = [])
|
public function engine($options = [])
|
||||||
{
|
{
|
||||||
$type = !empty($options['type']) ? $options['type'] : 'Think';
|
$type = !empty($options['type']) ? $options['type'] : 'Think';
|
||||||
$class = (!empty($options['namespace']) ? $options['namespace'] : '\\think\\view\\driver\\') . ucfirst($type);
|
$class = (!empty($options['namespace']) ? $options['namespace'] : '\\think\\view\\driver\\') . ucfirst($type);
|
||||||
|
|||||||
Reference in New Issue
Block a user