Welcome Guest, Not a member yet? Register   Sign In
Why MY_Controller.php in application/libraries not work on CI2.0?
#1

[eluser]CodeIgniterStep.Com[/eluser]
Dear All,

I have create MY_Controller.php in folder application/libraries/MY_Controller.php

MY_Controller.php
Code:
class MY_Controller extends CI_Controller
{
    public function MY_Controller()
    {
         parent::CI_Controller();
        
    }
}

and I created sample.php in folder application/controllers/sample.php

Code:
class Sample extends MY_Controller
{
    public function __construct()
    {
        parent::MY_Controller();
    }
    public function index()
    {
       //.....
    }
}

After I call to the URL http://localhost/index.php/sample it return error message
Quote:Fatal error: Class 'MY_Controller' not found in D:\xampp\htdocs\CI2\application\controllers\sample.php on line 2
#2

[eluser]CodeIgniterStep.Com[/eluser]
Oh sorry!!, I create it in folder application/core it work. Smile It is core application not libraries class :p

sorry for about that.




Theme © iAndrew 2016 - Forum software by © MyBB