I am working on a large project, made in Codeigniter and I am wondering if there is difference in the performance of an controller dependent, where the required models are loaded.
The question:
// Bear in mind, that the application I am working on, has mostly large models, with more then just the insert/update/del functions in them ...
// p.s. I've searched the net on the topic, but failed find anything specific in that subject.
Models that will be used consistently on all the site's pages are best autoloaded in the config/autoload.php
file. Models that are used throughout all the methods of a controller, should be loaded in that controller's constructor. Models that are only needed in certain methods within a controller, should be loaded inside those methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With