Reputation: 521
What is the difference of loading a library in CodeIgniter via,
Is there any point in loading the library in the constructor method of the controller class as,
$this->load->library(array('form_validation'));
when I can just load them at the autoload.php?
Thank you!
Upvotes: 0
Views: 262
Reputation: 748
Not loading all libraries in autoload is simply for performance reasons. If you rarely use a certain library, you might want to load it only when using it's relevant controller. Autoloading every library all the time could be "wasteful".
Upvotes: 2