Welcome Guest, Not a member yet? Register   Sign In
Autoloading helpers, models in config vs loading it in controller?
#1

[eluser]Michal1[/eluser]
Hello guys,

every code example I see does load its models, helpers and stuff like that in the controller function.

For example

Code:
function Test()  
    {  
        parent::Controller();  
        $this->load->model('test_model');  
  
    }

While I do all this stuff in config folder and autoloading that. Is this bad approach? If I understand it correctly the only reason why to load it only in certain controller is a speed right?
#2

[eluser]Stefan Hueg[/eluser]
Speed and memory consumption, yes. CodeIgniters approach, compared to other frameworks, is: Load as few files as possible.

That's the secret ingredient why I choose CodeIgniter among all others Smile




Theme © iAndrew 2016 - Forum software by © MyBB