diff --git a/library/think/View.php b/library/think/View.php index 65d9f72b..9582e969 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -91,6 +91,18 @@ class View 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 模板文件名或者内容 diff --git a/library/think/view/driver/Php.php b/library/think/view/driver/Php.php index 4b85e898..04af6df3 100644 --- a/library/think/view/driver/Php.php +++ b/library/think/view/driver/Php.php @@ -132,4 +132,16 @@ class Php 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) + { + + } + } diff --git a/library/think/view/driver/Think.php b/library/think/view/driver/Think.php index d7ac5954..f100def1 100644 --- a/library/think/view/driver/Think.php +++ b/library/think/view/driver/Think.php @@ -129,6 +129,22 @@ class Think 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) { return call_user_func_array([$this->template, $method], $params);