mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
View类增加config方法用于设置模板引擎参数 模板引擎驱动增加config接口方法
This commit is contained in:
@@ -91,6 +91,18 @@ class View
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置模板引擎
|
||||||
|
* @access private
|
||||||
|
* @param string|array $name 参数名
|
||||||
|
* @param mixed $value 参数值
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function config($name, $value = null)
|
||||||
|
{
|
||||||
|
$this->engine->config($name, $value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析和获取模板内容 用于输出
|
* 解析和获取模板内容 用于输出
|
||||||
* @param string $template 模板文件名或者内容
|
* @param string $template 模板文件名或者内容
|
||||||
|
|||||||
@@ -132,4 +132,16 @@ class Php
|
|||||||
return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.');
|
return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置模板引擎
|
||||||
|
* @access private
|
||||||
|
* @param string|array $name 参数名
|
||||||
|
* @param mixed $value 参数值
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function config($name, $value = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,22 @@ class Think
|
|||||||
return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.');
|
return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置模板引擎
|
||||||
|
* @access private
|
||||||
|
* @param string|array $name 参数名
|
||||||
|
* @param mixed $value 参数值
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function config($name, $value = null)
|
||||||
|
{
|
||||||
|
if (is_array($name)) {
|
||||||
|
$this->template->config($name);
|
||||||
|
} else {
|
||||||
|
$this->template->$name = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function __call($method, $params)
|
public function __call($method, $params)
|
||||||
{
|
{
|
||||||
return call_user_func_array([$this->template, $method], $params);
|
return call_user_func_array([$this->template, $method], $params);
|
||||||
|
|||||||
Reference in New Issue
Block a user