Codeigniter extending extended MY_Controller

前端 未结 5 678
慢半拍i
慢半拍i 2020-12-09 21:07

I have strictly followed the how-to article by Phil Sturgeon, to extend the base controller. But I get still some errors.

My 3 classes:

// applicatio         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 21:48

    I had problem like this,After some search I found error was made myself,Because my controller class name was MY_Controller but file name was My_Controller[Case not matching]. Note:- In localhost I didnt have any error.

    In extended controller I Use

    class Home  extends MY_Controller{
       function __construct() {
       parent::__construct();
      }
    }
    

    even I got the error.

    After changing my file name to MY_Controller it started to work well.

提交回复
热议问题