i have a problem im trying to deal with for a long time,
i have a codeigniter webapp that im building and i have a problem with the $this of codeigniter
i will show you with so examples:
this is in my controller
$this->site_model->blog_post('title');
this one work perfectly /\
if im loading an other / different model it will load it all good, but if im calling a function in the new model like this:
$this->Admin_model->blog_post('title');
it will give me this
Undefined property: Idx::$Admin_model
Call to a member function get_categories() on a non-object in
C:\dev\wamp\www\francebeautycoil\application\controllers\idx.php on line 22
if im doing the next code
public $ci = '';
$this->ci =& get_instance();
$this->load->model('Admin_model');
$this->ci->Admin_model->blog_post('title');
it will work.
ive tryed all the catital lettes, lowercase letters.
the thing is that its append not only on this model but on few libraries too.
please help, im stuck.
Every time you use an model you need to load it first , on second snipped you need to load Admin_model first
if im loading an other / different model
On second snppiet you are calling a method on Admin_model not loading it on line below
$this->Admin_model->blog_post('title');
so load it first
$this->load->model('Admin_model');
so it becomes
$this->load->model('Admin_model');
$this->Admin_model->blog_post('title');