Welcome Guest, Not a member yet? Register   Sign In
Question about class loading
#6

[eluser]xwero[/eluser]
It doesn't matter, from a loading point of view, if you put it in the construct method or in an other method because the library gets loaded only once. Even if you write something like
Code:
function __construct() {
parent::__construct();
$this->load->library('xxx');
}

function show() {
$this->load->library('xxx'); // this will be disregarded
}

From the memory point of view you better only load the library when it's needed. That means load it in the methods that need it and only load it in the construct method if (nearly) all other methods of the controller need it.


Messages In This Thread
Question about class loading - by El Forum - 11-17-2008, 04:44 AM
Question about class loading - by El Forum - 11-17-2008, 05:11 AM
Question about class loading - by El Forum - 11-17-2008, 05:43 AM
Question about class loading - by El Forum - 11-17-2008, 06:00 AM
Question about class loading - by El Forum - 11-17-2008, 07:09 AM
Question about class loading - by El Forum - 11-17-2008, 07:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB