Basic Model Help - 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: Basic Model Help (/showthread.php?tid=32738) |
Basic Model Help - El Forum - 08-03-2010 [eluser]Unknown[/eluser] Hi, Can someone help me with Models. I can get controllers / views / helpers working easily but I am struggling with models. Here is my small test controllers; Code: class Test extends Controller{ And my test model; Code: class Testmodel extends Model { What I am expecting to be displayed is; aaa aa Is that correct ? I cant seem to get it to work when it loads the model. Basic Model Help - El Forum - 08-03-2010 [eluser]mddd[/eluser] Yes what you expect is correct. But if you load a model, you have to use the entire name. Code: $this->load->model('testmodel'); If you want a different name or if you need multiple instances of the same model, you can specify the name: Code: $this->load->model('testmodel', 'test1'); |