CodeIgniter Forums
call functions in two controller problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: call functions in two controller problem (/showthread.php?tid=42580)



call functions in two controller problem - El Forum - 06-11-2011

[eluser]Unknown[/eluser]
I hava a question here that I want to call a function in Controller A, but the function itself is in Controller B,how to deal with it?Help~


call functions in two controller problem - El Forum - 06-11-2011

[eluser]John_Betong_002[/eluser]
Try searching for MY_Controller.

Basically your common function resides in MY_Controller and both Controller_A and Controller_B inherit MY_Controller.
 
 


call functions in two controller problem - El Forum - 06-11-2011

[eluser]CroNiX[/eluser]
Either that or make a library with the common functions.