mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进模板引擎的表达式语法
This commit is contained in:
@@ -66,6 +66,8 @@ class Template
|
|||||||
{
|
{
|
||||||
$this->config['cache_path'] = TEMP_PATH;
|
$this->config['cache_path'] = TEMP_PATH;
|
||||||
$this->config = array_merge($this->config, $config);
|
$this->config = array_merge($this->config, $config);
|
||||||
|
$this->config['taglib_begin_origin'] = $this->config['taglib_begin'];
|
||||||
|
$this->config['taglib_end_origin'] = $this->config['taglib_end'];
|
||||||
$this->config['taglib_begin'] = $this->stripPreg($this->config['taglib_begin']);
|
$this->config['taglib_begin'] = $this->stripPreg($this->config['taglib_begin']);
|
||||||
$this->config['taglib_end'] = $this->stripPreg($this->config['taglib_end']);
|
$this->config['taglib_end'] = $this->stripPreg($this->config['taglib_end']);
|
||||||
$this->config['tpl_begin'] = $this->stripPreg($this->config['tpl_begin']);
|
$this->config['tpl_begin'] = $this->stripPreg($this->config['tpl_begin']);
|
||||||
|
|||||||
@@ -264,8 +264,8 @@ class TagLib
|
|||||||
if (!empty($this->tags[$name]['expression'])) {
|
if (!empty($this->tags[$name]['expression'])) {
|
||||||
static $_taglibs;
|
static $_taglibs;
|
||||||
if (!isset($_taglibs[$name])) {
|
if (!isset($_taglibs[$name])) {
|
||||||
$_taglibs[$name][0] = strlen(ltrim($this->tpl->config('taglib_begin'), '\\') . $name);
|
$_taglibs[$name][0] = strlen($this->tpl->config('taglib_begin_origin') . $name);
|
||||||
$_taglibs[$name][1] = strlen(ltrim($this->tpl->config('taglib_end'), '\\'));
|
$_taglibs[$name][1] = strlen($this->tpl->config('taglib_end_origin'));
|
||||||
}
|
}
|
||||||
$result['expression'] = substr($str, $_taglibs[$name][0], -$_taglibs[$name][1]);
|
$result['expression'] = substr($str, $_taglibs[$name][0], -$_taglibs[$name][1]);
|
||||||
// 清除自闭合标签尾部/
|
// 清除自闭合标签尾部/
|
||||||
|
|||||||
Reference in New Issue
Block a user