1.php
$zNodes = "["; foreach ($dept_list as $key => $val) { $typeurl = url('wxusers/deptshowuser', array('typeid'=>$val['dept_id'])); $typename = $val['dept_name']; $zNodes .= "{"."id:{$val['dept_id']}, pId:{$val['parent_id']}, name:\"{$typename}\", url:'{$typeurl}',target:'content_body'"; /*默认展开一级栏目*/ if ($val['parent_id'] == 0) { $zNodes .= ",open:false"; } /*--end*/ /*栏目有下级栏目时,显示图标*/ if ($val['is_haveson'] == 1 && $val['parent_id'] == 0) { $zNodes .= ",isParent:true"; } else { $zNodes .= ",isParent:false"; } /*--end*/ $zNodes .= "},"; } $zNodes .= "]"; $this->assign('zNodes', $zNodes);
2.前端
本文为看恩吧原创文章,转载无需和我联系,但请注明来自knsay.com