<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的值是一样的字符串数字呀!为何对比后不能做出正确判断?


最佳答案
