[eluser]Unknown[/eluser]
Hi I'm trying to create a new controller extending from CI_Controller. My problem starts here. When I try to put the name to that controller, the only name that the system accepts is MY_Controller.
I have one file called MY_ControllerAA.php with this code in Application/core
Code:
<?php
class MY_ControllerAA extends CI_Controller {
protected $photos;
public function __construct()
{
parent::__construct();
$this->photos = 0;
}
public function set_photos($number){
$this->photos = $number;
}
public function get_photos(){
return $this->photos;
}
}
And I have another file in application/controllers called welcome.php with this code
Code:
<?php
class Welcome extends MY_ControllerAA {
function __construct()
{
parent::__construct();
$this->set_photos(3);
}
function index()
{
echo $this->get_photos();
}
}
It's only a test code but when I try to get the index function I get this error
Fatal error: Class 'MY_ControllerAA' not found in /Applications/MAMP/htdocs/mallorcadiving/intranet_mallorcadiving/application/controllers/welcome.php on line 2
When I change the name of my class to MyController it works fine. I don't know why it is. Could someone help me?
Lots of thanks