CodeIgniter Forums
loading a controller function in another controller function - 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: loading a controller function in another controller function (/showthread.php?tid=53755)



loading a controller function in another controller function - El Forum - 08-07-2012

[eluser]Unknown[/eluser]
let suppose i have a controller Controller_A and it's function A and another Controller_B and it's function is B

can i call function A of Controller_A from inside the Controller_B function B




loading a controller function in another controller function - El Forum - 08-07-2012

[eluser]TWP Marketing[/eluser]
Rethink what you want to do.
You have the same function which is performed by two different controllers.
Move this function to a model and load that model in each controller.
Avoid the duplication of code.


loading a controller function in another controller function - El Forum - 08-07-2012

[eluser]CroNiX[/eluser]
Sounds like a great place to use a library.