国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > DedeCMS > Dede标签dede:global使用function属性的问题

Dede标签dede:global使用function属性的问题

来源:程序员人生   发布时间:2013-10-31 20:24:32 阅读次数:3514次

网(LieHuo.Net)教程 关于标签dede:global下使用function属性的问题及解决方法,请看下面的分析:

版本v5.5

使用
{dede:global name='keyword' /}可以正常获取到keyword的值,
加入function后
{dede:global name='keyword' function='str_replace(" ","-",@me)' /}keyword的值为空.

看了一个上午,终于解决了问题.是一个bug.

解决方案:
找到include/dedetag.class.php
找到第423行:

$str = $this->EvalFunc( $this->CTags[$i]->TagValue, $this->CTags[$i]->GetAtt('function'),$this->CTags[$i] );

修改为:

$str = $this->EvalFunc( $str, $this->CTags[$i]->GetAtt('function'),$this->CTags[$i] );

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生