I am writing a webapp using CodeIgniter that requires authentication. I created a model which handles all my authentication. However, I can\'t find a way to access this auth
It seems you can load models inside models, although you probably should solve this another way. See CodeIgniter forums for a discussion.
class SomeModel extends Model
{
function doSomething($foo)
{
$CI =& get_instance();
$CI->load->model('SomeOtherModel','NiceName',true);
// use $CI instead of $this to query the other models
$CI->NiceName->doSomethingElse();
}
}
Also, I don't understand what Till is saying about that you shouldn't create objects inside objects. Of course you should! Sending objects as arguments looks much less clear to me.