mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Template类改进 模板解析增加 $Request. 特殊变量解析
This commit is contained in:
@@ -854,6 +854,11 @@ class Template
|
|||||||
if ('$Think' == $first) {
|
if ('$Think' == $first) {
|
||||||
// 所有以Think.打头的以特殊变量对待 无需模板赋值就可以输出
|
// 所有以Think.打头的以特殊变量对待 无需模板赋值就可以输出
|
||||||
$parseStr = $this->parseThinkVar($vars);
|
$parseStr = $this->parseThinkVar($vars);
|
||||||
|
} elseif ('$Request' == $first) {
|
||||||
|
// 获取Request请求对象参数
|
||||||
|
$method = array_shift($vars);
|
||||||
|
$params = !empty($vars) ? '\'' . implode('.', $vars) . '\'' : '';
|
||||||
|
$parseStr = '\think\Request::instance()->' . $method . '(' . $params . ')';
|
||||||
} else {
|
} else {
|
||||||
switch ($this->config['tpl_var_identify']) {
|
switch ($this->config['tpl_var_identify']) {
|
||||||
case 'array': // 识别为数组
|
case 'array': // 识别为数组
|
||||||
|
|||||||
Reference in New Issue
Block a user