mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
view类增加show方法
This commit is contained in:
@@ -114,7 +114,7 @@ class Controller
|
||||
*/
|
||||
public function show($content, $vars = [])
|
||||
{
|
||||
return $this->view->fetch($content, $vars, '', true);
|
||||
return $this->view->show($content, $vars);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,10 +58,11 @@ class View
|
||||
/**
|
||||
* 设置视图参数
|
||||
* @access public
|
||||
* @param array $config 视图参数
|
||||
* @param mixed $config 视图参数或者数组
|
||||
* @param string $value 值
|
||||
* @return View
|
||||
*/
|
||||
public function config(array $config = [])
|
||||
public function config($config = '',$value='')
|
||||
{
|
||||
if (is_array($config)) {
|
||||
foreach ($this->config as $key => $val) {
|
||||
@@ -69,8 +70,10 @@ class View
|
||||
$this->config[$key] = $config[$key];
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}else{
|
||||
$this->config[$config] = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,6 +151,18 @@ class View
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染内容输出
|
||||
* @access public
|
||||
* @param string $content 内容
|
||||
* @param array $vars 模板输出变量
|
||||
* @return mixed
|
||||
*/
|
||||
public function show($content, $vars = [])
|
||||
{
|
||||
return $this->fetch($content, $vars, '', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动定位模板文件
|
||||
* @access private
|
||||
|
||||
Reference in New Issue
Block a user