THINKPHP的模版引擎中的IF语句未什么失效?

浏览:2150 发布日期:2013/04/14 分类:求助交流
<option value="<{$vo.topid}>" <if condition="$vo.current eq $vo.topid">selected="selected"<else /></if>>
<for start="1" end="$vo.nbsp"> </for>|- <{$vo.name}>
</option>
THINKPHP的模版引擎中的IF语句,这写没效果。。。
但如果把判断中的$vo.topid改为2就有效果了。。这是为啥呀
控制器里是这么写的:$sort=M('LinkSort');
        $listadd = $sort->field("topid,twoid,path,sequence,name,CONCAT(path,'-',topid) AS bpath")->order('bpath')->select();
        $current = $sort->where("topid=".$_GET['id'])->find();
        foreach ($listadd AS $key=>$val){
            $listadd[$key]['nbsp']=  count(explode('-', $val['bpath']));
            if($current['topid'] == $listadd[$key]['topid']){
                $listadd[$key]['current'] = $current['topid'];
            }
        }
        $this->assign('listadd',$listadd);
        $this->display('Editor');
$vo.current的值和$vo.topid的值是一样的字符串数字呀!
为何对比后不能做出正确判断?

最佳答案
评论( 相关
后面还有条评论,点击查看>>