Welcome Guest, Not a member yet? Register   Sign In
Is it Allowed to Make loading of Resources Global to a controller?
#1

[eluser]n00bPhpCoder[/eluser]
instead of loading them via functions can we do this?


say

function index(){
$this->load->model('downloadmodel','dl');
$data['downloads']=$this->dl->getEntries(2);
$this->load->view('home',$data);
}

instead of loading the model in index function i need to load it globally so that other functions can use the model too.

like can i load it on constructor

function Home()
{
parent::Controller();
$this->load->model('downloadmodel','dl');
}

so that the model object is also available on other functions?

function no1{
$this->dl->something
}

function no2{
$this->dl->something

}

Any Ideas?


Messages In This Thread
Is it Allowed to Make loading of Resources Global to a controller? - by El Forum - 07-15-2007, 08:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB