编辑的时候选择一个很多选择的东西,所以把文章按照等级来进行选择

action代码:

$category=new Model('Category');
        $article=new Model('Article');
        $yila=$category->query("select * from zs_category where pid  in (select id from zs_category where pid=0)");
        $erla=$category->query("select * from zs_category where pid in  (select id from zs_category where pid in (select id from zs_category where pid=0))");
        $sanla=$article->select();
        $count=count($yila);
        $count1=count($erla);
        $this->assign("count",$count);
        $this->assign("count1",$count1);
        $this->assign("yila",$yila);
        $this->assign("erla",$erla);
        $this->assign("sanla",$sanla);

模版代码:


     
            
            
            
                                                                                                                                
            



模版中的js代码:


                                                                           
  

然后把模版提交上来的数据添加到数据可就可以了。

问题:option中没有value怎样提交数据到服务器?

array[{$i}]=newArray("{$yila['name']}","根目录","{$yila['name']}");

这句里面,第二个参数是父级的名字,第三个参数是显示的名字

第一个参数就是value,同时它也是别人的父级名字


--------------------------------------------

开发过程中遇到一个问题,就是js显示不出来错误,但是之前是可以的,对比一看,是增加某一个功能之后添加了相同名字的js动作,导致js显示错误,所以一定要注意js的名字不能一样