CodeIgniter Forums
controller from controller - once and for all - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: controller from controller - once and for all (/showthread.php?tid=16623)

Pages: 1 2


controller from controller - once and for all - El Forum - 03-12-2009

[eluser]wiredesignz[/eluser]
Sure, and there is nothing incorrect in loading a class from anywhere, Just don't expect a second controller descendent to act the same as the first controller does. Smile


controller from controller - once and for all - El Forum - 03-12-2009

[eluser]TheFuzzy0ne[/eluser]
Perhaps I'm missing the point here, but what's wrong with a good old fashioned redirect?


controller from controller - once and for all - El Forum - 03-12-2009

[eluser]xwero[/eluser]
The idea of the mihailt’s function is to use the content of another controller in the current controller.
Code:
$other_ctrl = load_controller('othercontroller');
$data['header'] = $other_ctrl->method($this->uri->segment(3));
The wick library makes this possible and HMVC takes it to an whole other level.


controller from controller - once and for all - El Forum - 03-13-2009

[eluser]mihailt[/eluser]
hi guys, i realized where, my code didn't do what i wanted, and i made an extension which allows to work with controllers the same way as libraries and doesn't create more CI instances.
check it out : CLE - Controller Loader Extension


controller from controller - once and for all - El Forum - 06-17-2009

[eluser]rbncha[/eluser]
Wow ! I just loved this. Thanks to the creator of this.