最新版本吗,去对应的文件夹下View/pro/index.html那

解决方案 »

  1.   


    3.2.2的,这是基于thinkphp的cms,我在想是不是cms本身有什么配置文件没有设置,因为其它本身的 控制器都可以使用的。
      

  2.   

    对tp熟悉吗?最好了解tp本身的架构,不管那个CMS碰到什么问题都可以搞定
    仅仅复制一个分组,说不准哪有BUG
      

  3.   

    会点yii,没看过tp,这两天就在弄,然后就发现问题了
      

  4.   

    发一下报错的控制器吧...
    不过我个人建议你把时间分配在学习thinkphp上,不然后面再有其他问题也不好办
      

  5.   

    复制的控制器:
    <?php
    namespace Ra\Controller;
    use Think\Controller;
    class IndexController extends Controller {
        public function index($page=1){
            if(!is_numeric($page)) {
            $this->error('参数错误');
            }
            if($_GET['keyword']) {
            $where['content']  = array('like', "%{$_GET['keyword']}%");
    $where['title']  = array('like',"%{$_GET['keyword']}%");
    $where['_logic'] = 'or';
    $condition['_complex'] = $where;
    $condition['type']  = 'pro';
            $this->page = M('page')->where($condition)->order('id desc')->page($page,mc_option('page_size'))->select();
            $count = M('page')->where($condition)->count();
            $this->assign('count',$count);
            $this->assign('page_now',$page);
            $this->display('Ra/index');
            } else {
                
            $condition['type'] = 'pro';
            $this->page = M('page')->where($condition)->order('id desc')->page($page,mc_option('page_size'))->select();
            $count = M('page')->where($condition)->count();
            $this->assign('count',$count);
            $this->assign('page_now',$page);
            $this->theme(mc_option('theme'))->$this->display('Ra/index');
        };
           }
    原件:
    <?php
    namespace Pro\Controller;
    use Think\Controller;
    class IndexController extends Controller {
        public function index($page=1){
            if(!is_numeric($page)) {
            $this->error('参数错误');
            }
            if($_GET['keyword']) {
            $where['content']  = array('like', "%{$_GET['keyword']}%");
    $where['title']  = array('like',"%{$_GET['keyword']}%");
    $where['_logic'] = 'or';
    $condition['_complex'] = $where;
    $condition['type']  = 'pro';
            $this->page = M('page')->where($condition)->order('id desc')->page($page,mc_option('page_size'))->select();
            $count = M('page')->where($condition)->count();
            $this->assign('count',$count);
            $this->assign('page_now',$page);
            $this->display('pro/index');
            } else {
            $condition['type'] = 'pro';
            $this->page = M('page')->where($condition)->order('id desc')->page($page,mc_option('page_size'))->select();
            $count = M('page')->where($condition)->count();
            $this->assign('count',$count);
            $this->assign('page_now',$page);
            $this->theme(mc_option('theme'))->display('pro/index');
        };
        }
    调试到最后一步的时候就显示404;到$this->theme(mc_option('theme'))这个值还是一样的。就是display输出不行,即使改成原件的也不行
      

  6.   

    $this->theme(mc_option('theme'))->$this->display('Ra/index');
    $this->theme(mc_option('theme'))->display('pro/index');
    你看
      

  7.   

    呃,不是的,我之前是分开了为了调试,$this->theme(mc_option('theme')); $this->display('Ra/index');然后为了让你看的一样我删除回去没整好.我是直接复制原件了的。
      

  8.   

    弄了个test.php 输出的模板貌似有问题估计参数没有对上才会跳转404。我再查查、
      

  9.   


    是不是控制器中全局替换的Ra,而View文件夹下还是pro?