Welcome Guest, Not a member yet? Register   Sign In
Only Load Model in construct ??? Why
#1

[eluser]Snoob[/eluser]
I have the code:
Quote: function index()
{
$this->load->model('user_Model');
$this->user_Model->a();
}
The method a() is used to echo A; (because this only is example);
But it not working.
After I have the code:
Quote: function __construct()
{
parent::Controller();
$this->load->model('user_Model');
}

function index()
{

$this->user_Model->a();
}
And It've worked, why?


Messages In This Thread
Only Load Model in construct ??? Why - by El Forum - 04-07-2009, 06:36 AM
Only Load Model in construct ??? Why - by El Forum - 04-07-2009, 06:51 AM
Only Load Model in construct ??? Why - by El Forum - 04-07-2009, 07:00 AM
Only Load Model in construct ??? Why - by El Forum - 04-07-2009, 07:10 AM
Only Load Model in construct ??? Why - by El Forum - 04-07-2009, 07:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB