![]() |
call a model function in other file - 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: call a model function in other file (/showthread.php?tid=8697) |
call a model function in other file - El Forum - 05-27-2008 [eluser]Mitja[/eluser] Why this is not working. I want to use it in view/admin/arrangement_edit.php Code: <tr> this is model/function_model.php file Code: class Function_model extends Model { call a model function in other file - El Forum - 05-27-2008 [eluser]Lone[/eluser] First thing to check is does the function work within the controller that you loaded that view from? call a model function in other file - El Forum - 05-27-2008 [eluser]Michael Wales[/eluser] Without seeing the controller I'd say you probably have not loaded the model (the model must be loaded and the object instantiated - which CodeIgniter does for you - prior to using it). Code: $this->load->model('function_model'); We can get into the debate of calling a model from a view and how this should be a helper later. ![]() |