CodeIgniter Forums
Load controller as class - 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: Load controller as class (/showthread.php?tid=10920)



Load controller as class - El Forum - 08-18-2008

[eluser]Unknown[/eluser]
Hello =)

I searching for support about this question:

I want to load controller into another controller. I mean I have a sub-dir of a controller.. with many other controllers in it. For example one controller will be main.php and other is view.php. When you want to log in a user, the html form will send data to main.php. This controller will check data for validation, it will load module to check DB stuff... and then I want to load controller view.php for method which will decide to show an error template or to show logged in menu template. I mean I want to separate controller into several parts..One will be for interface [maybe I want to use console or xml output..] and another one is for main functionality.

In anyway I want to have a lot of controllers in subdir which can interact with each other. or.. "I just want to load controller as a class" ... as you can do it now with libraries..

Any solutions =)? Thnx


Load controller as class - El Forum - 08-19-2008

[eluser]sikkle[/eluser]
Hi Holms, you solution is totally fitting with the HMVC goal.


http://codeigniter.com/wiki/Modular_Extensions_-_HMVC/

That will make you possible to create module, that you gonna call directly inside any other stuff like a library.

Good luck with your stuff.