Welcome Guest, Not a member yet? Register   Sign In
cannot load model in CI 1.72 using modular extention
#1

[eluser]didit[/eluser]
hi there, please help my problems to load model in controller inside modules
here's my code :

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

Code:
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


Messages In This Thread
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 03:20 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 03:36 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 03:42 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 04:08 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 04:18 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 05:04 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 07:33 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 07:35 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 07:50 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 07:51 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 07:54 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 07:56 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 08:00 AM
cannot load model in CI 1.72 using modular extention - by El Forum - 01-18-2010, 08:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB