hi there, please help my problems to load model in controller inside modules
here’s my code :
class Testing extends Controller {
function Testing() {
parent::Controller();
}
function getAll() {
$this->load->model('Testing2');
$data = $this->Testing2->getAll();
}
}
class Testing2 extends Model {
function Testing2() {
// Call the Model constructor
parent::Model();
}
function getAll() {
$items = array();
$items[0] = 'Didit';
return $items;
}
}
my source code locate at system/application/modules/testing/
when i running http://localhost:81/ci-172/index.php/testing/getAll on my IE
i got this messege on the screen
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI::$Testing2
Filename: libraries/Controller.php
Line Number: 351
Fatal error: Call to a member function getAll() on a non-object in D:\xampp\xampp\htdocs\ci-172\system\application\modules\testing\controllers\testing.php on line 11
did i miss something ??
thanks
