• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending CI_Controller

#1
[eluser]Unknown[/eluser]
Hy guys!

I am trying to extend CI_Controller class.

I have created a file, named "MY_Backend_Controller.php" and placed into "application/core/".
The file contains the following code:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Backend_Controller extends CI_Controller {

}

But when i try somethig like this:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends MY_Backend_Controller {

public function index()
{
  $this->load->view('welcome_message');
}

}
It says "Fatal error: Class 'MY_Backend_Controller' not found ...".

If I replace the name of the class "MY_Backend_Controller" with "MY_Controller" it works! I don't get it why!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.