![]() |
Loading just about anything is not working correctly - 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: Loading just about anything is not working correctly (/showthread.php?tid=24559) |
Loading just about anything is not working correctly - El Forum - 11-12-2009 [eluser]Unknown[/eluser] The environment is using 1.7.2. First things first, I've extended the form_validation library according to the user guide: Code: class MY_Form_validation extends CI_Form_validation { This is placed in the application/libraries directory just as I have done numerous times before. However, I get "Fatal error: Call to undefined method CI_Form_validation: ![]() Second, and the reason for the topic, is that EVERY model, library or help must load in the constructor of the controller. This is a regression as I've brought over code from other projects where I will load $this->load->model('user_model'); on the functions that are specific to users. IE when I try to load this in my "function add_user()" page and call $this->user_model->insert_user($data) I get the error that "Call to a member function insert_user() on a non-object". I've found that if I do $ci =& get_instance() and load the model from there in the function that it works. Help!? |