mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
修正单元测试 删除controller类show方法 用 display方法替代
This commit is contained in:
@@ -82,7 +82,7 @@ class Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载模板和页面输出 可以返回输出内容
|
||||
* 加载模板输出
|
||||
* @access public
|
||||
* @param string $template 模板文件名
|
||||
* @param array $vars 模板输出变量
|
||||
@@ -95,7 +95,7 @@ class Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载模板和页面输出 可以返回输出内容
|
||||
* 渲染内容输出
|
||||
* @access public
|
||||
* @param string $template 模板文件名
|
||||
* @param array $vars 模板输出变量
|
||||
@@ -107,18 +107,6 @@ class Controller
|
||||
return $this->view->display($template, $vars, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染内容输出
|
||||
* @access public
|
||||
* @param string $content 内容
|
||||
* @param array $vars 模板输出变量
|
||||
* @return mixed
|
||||
*/
|
||||
public function show($content, $vars = [])
|
||||
{
|
||||
return $this->view->show($content, $vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板变量赋值
|
||||
* @access protected
|
||||
|
||||
@@ -30,9 +30,11 @@ class View
|
||||
'engine_config' => [],
|
||||
];
|
||||
|
||||
public function __construct(array $config = [])
|
||||
public function __construct($config = [])
|
||||
{
|
||||
$this->config($config);
|
||||
if (is_array($config)) {
|
||||
$this->config($config);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,7 +43,7 @@ class View
|
||||
* @param array $config 配置参数
|
||||
* @return object
|
||||
*/
|
||||
public static function instance(array $config = [])
|
||||
public static function instance($config = [])
|
||||
{
|
||||
if (is_null(self::$instance)) {
|
||||
self::$instance = new self($config);
|
||||
|
||||
Reference in New Issue
Block a user