CodeIgniter Forums
HMVC - Extend MX_Controller gives me an error, CI_Controller do not!? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: HMVC - Extend MX_Controller gives me an error, CI_Controller do not!? (/thread-55193.html)



HMVC - Extend MX_Controller gives me an error, CI_Controller do not!? - El Forum - 10-14-2012

[eluser]Sven Delle[/eluser]
I read that I should extend with MX_Controller if I use HMVC for codeigniter. But I've never managed to ever extend that. I've always used CI_Controller.

Now, can anyone explain to me why that is - and what's the point of saying I should use MX_Controller when I can't?


HMVC - Extend MX_Controller gives me an error, CI_Controller do not!? - El Forum - 10-14-2012

[eluser]PhilTem[/eluser]
If you just want to have modular separation, you are fine with extending CI_Controller. If you want to call other modules' controllers from within your current controller, both controllers need to extend MX_Controller.

If you get an error extending MX_Controller make sure you are including the MX_Controller file:
Code:
include(APPPATH . 'third_party/MX/Controller.php');