CodeIgniter Forums
HMVC and MY_Controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: HMVC and MY_Controller (/showthread.php?tid=38300)



HMVC and MY_Controller - El Forum - 02-04-2011

[eluser]Unknown[/eluser]
Hi all!

First of all sorry for my English.
I'm trying to use Wiredesignzs Modular Extension, and i love it. It's really good job! The thing is that i don't know if I'm using it in proper way. Let's say i have a few modules, every controller extending MY_Controller which is extending MX_Controller. So when I run $this->load->module('foo') in controller bar. It is running constructor of MY_Controller twice. If in some method I'm loading several modules it's running MY_Controller constructor several times. In MY_Controller constructor I'm setting some view variables which are common for whole modules, so i don't want to set them in every controller. Is there another way to do it, cause it's getting low performance and script execution time is quite long.