view助手函数增加replace参数 取消ViewResponse类的vars方法 使用assign方法替代

This commit is contained in:
thinkphp
2016-07-20 12:20:38 +08:00
parent f3302d6e38
commit ab5dfcf111
3 changed files with 11 additions and 22 deletions

View File

@@ -36,18 +36,6 @@ class View extends Response
->fetch($data, $this->vars, $this->replace);
}
/**
* 视图变量赋值
* @access public
* @param array $vars 模板变量
* @return $this
*/
public function vars($vars = [])
{
$this->vars = $vars;
return $this;
}
/**
* 获取视图变量
* @access public
@@ -56,11 +44,11 @@ class View extends Response
*/
public function getVars($name = null)
{
if(is_null($name)){
if (is_null($name)) {
return $this->vars;
}else{
} else {
return isset($this->vars[$name]) ? $this->vars[$name] : null;
}
}
}
/**