mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
优化视图,支持连操作,如:
return View::getInstance(Config::get())->assign($vars)->fetch();
This commit is contained in:
@@ -40,6 +40,14 @@ class View
|
||||
$this->config($config);
|
||||
$this->engine($this->config['engine_type']);
|
||||
}
|
||||
/**
|
||||
* 初始化视图
|
||||
* @access public
|
||||
* @param array $config 配置参数
|
||||
*/
|
||||
static public function getInstance(array $config = []){
|
||||
return self($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板变量赋值
|
||||
@@ -55,6 +63,7 @@ class View
|
||||
} else {
|
||||
$this->data[$name] = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user