網(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] );