![]() |
cannot load model in CI 1.72 using modular extention - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: cannot load model in CI 1.72 using modular extention (/showthread.php?tid=26586) Pages:
1
2
|
cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [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 { 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 did i miss something ?? thanks cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]flaky[/eluser] do this Code: $this->load->model('testing2'); cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]didit[/eluser] waw it's work, many thanks cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]wiredesignz[/eluser] [quote author="flaky" date="1263828987"]do this[/quote] @flaky, This is truly the best help that I have ever seen. ![]() cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]didit[/eluser] hi all, i have do some change in the model, see source code below : Code: class Testing2 extends Model { i got : Code: A PHP Error was encountered please advice , thanks cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]flaky[/eluser] @wiredesignz doing my best some minor changes Code: function getAll() { I recommend you use active record your method with active record Code: function getAll() { cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]didit[/eluser] hi flaky, i have changed my source code based on your suggest above, but the system still show the same error A PHP Error was encountered Severity: Notice Message: Undefined property: Testing2::$db Filename: models/testing2.php Line Number: 13 error msg (without active record): Fatal error: Call to a member function query() error msg (with active record): Fatal error: Call to a member function select() why $this->db is not an object??? why Testing2::$db is undefined ?? should i initialize something (db connection, etc) in controller's constructor ?? Thanks in advance cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]flaky[/eluser] have you configured your database.php? cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]didit[/eluser] yups, in system/application/config/database.php i just change value of username, passworrd and databasename $db['default']['username'] = "root"; $db['default']['password'] = ""; $db['default']['database'] = "myci"; just FYI, if i use CI without modular extention everything works fine !! cannot load model in CI 1.72 using modular extention - El Forum - 01-18-2010 [eluser]flaky[/eluser] are you autoloading the database? |