非法操作,和空操作问题求助

浏览:999 发布日期:2014/01/17 分类:求助交流
http://localhost/sanfeng/about,这里的about其实是个空模块,真正的模块式achive,我弄了个空操作,通过about指向了achive模块的index操作,可以正常运行,但是我想http://localhost/sanfeng/about/detail/这个地址,指向http://localhost/sanfeng/archive/detail/,archive模块下的detail操作时,报错,非法操作class EmptyAction extends Action {

    function index() {
        //echo MODULE_NAME;
        $Sort=M('Sort');
        $url="'".strtolower(MODULE_NAME)."'";//这里获取到about
        $routaction=$Sort->where('url='.$url)->field('pointmodule,pointsort,showtype')->find();//根据url差不此url指向的模块,id,和显示方式
        //print_r($routaction);
        $rout=$routaction['pointmodule'];
        $child=$Sort->where('pid='.$routaction['pointsort'])->field('id')->select();//查询子类
        if(!empty($child)){//如果有子类,则获取说有子类的id,共文章查询显示
            foreach($child as $v){
                $sorts.=$v['id'].',';
            }
        }else{
            $sorts=$routaction['pointsort'];
        }
        switch ($rout) {
            case "Archive":
                if($_GET['id']){
                    R('Archive/detail');
                    echo 'aaa';
                }
                if($routaction['showtype'] == 0){
                   R('Archive/ypdetail',array($sorts));
                }//单页
                elseif($routaction['showtype'] == 1){//列表
                    R('Archive/index',array($sorts));
                }else{
                    echo '路由错误...';
                }
                break;
            case "Product":
                echo "Product";
                break;
        }
    }

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