Welcome Guest, Not a member yet? Register   Sign In
Loading a Model - Base_URL???
#1

[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.
#2

[eluser]jblack199[/eluser]
$this->load->model('twitterfeed');
#3

[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');

$this->Model_name->function();




Theme © iAndrew 2016 - Forum software by © MyBB