ahcheqiu 发表于 2015-5-20 12:20:26

扩展已经扩展过的CI_Controller提示没找到类

本帖最后由 ahcheqiu 于 2015-5-29 12:17 编辑

有这么2个类放在application/core里面A_Controller extends CI_Controller
B_Controller extends A_Controller
然后
Class extends A_Controller用Class\method能正常运行

Class extends B_Controller用Class\method提示找不到B_Controller
这里是什么问题呢

ahcheqiu 发表于 2015-5-20 12:25:18

对了,config文件里面把subclass_prefix设置成了A
是因为这个原因么?

ahcheqiu 发表于 2015-5-29 11:42:42

确定了,应该是CI不支持这种在控制器类再扩展出来的类,需要手动require_once

晨风_NS8UZ 发表于 2015-6-6 15:39:19

能说的再具体一点么,访问路径怎么写

晨风_NS8UZ 发表于 2015-6-6 15:40:51

*/
class Resetpwd extends CI_Controller (MY_Controller)
{
       
        function __construct()
        {
                # code...
                parent::__construct();
        }

        public function index()
        {
                echo "index";
        }

        public function message($p1,$p2)
        {
                echo "message".$p1.$p2;
        }
}

继承CI_Controller就能正常访问,继承MY_Controller, 永远都到index里面,很奇怪
页: [1]
查看完整版本: 扩展已经扩展过的CI_Controller提示没找到类