Loading a Model - Base_URL??? |
[eluser]Unknown[/eluser]
Hi, this is killing me. Im a noob and I can't get this right. I have a website. I load a module in the controller. It works great when the URL is like so: www.website.com/ But if the website is like so: www.website.com/projects/project_name/ The whole thing bugs out with the following notice: Quote: Undefined property: CI_Loader::$twitmodel I am including the model with the following code on all pages: Code: $this->twitmodel->twitterfeed(); Let me know if you need more info.
[eluser]praveens[/eluser]
Use this Code: $this->load->model('twitmodel/twitterfeed'); Once loaded, you will access your model functions using an object with the same name as your class: Code: $this->load->model('Model_name'); |
Welcome Guest, Not a member yet? Register Sign In |