Access to libray or model from another model - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Access to libray or model from another model (/showthread.php?tid=10723) |
Access to libray or model from another model - El Forum - 08-10-2008 [eluser]Unknown[/eluser] Hello people. I am sorry for my bad english. But I have a question. Can I load the library or model from another model? This error "A PHP Error was encountered Severity: Notice Message: Undefined property: Files_model::$catalog Filename: models/files_model.php Line Number: 9 Fatal error: Call to a member function set_cat_type() on a non-object in D:\server\www\lehe\core\application\models\files_model.php on line 9" appears when I tryed to execute this code: Code: class Files_model extends Model Access to libray or model from another model - El Forum - 08-10-2008 [eluser]m4rw3r[/eluser] Models have problems with accessing libraries and such, use the CI instance instead: Code: $CI =& get_instance(); Access to libray or model from another model - El Forum - 08-10-2008 [eluser]Unknown[/eluser] Thank you. It is working! =) |