CodeIgniter Forums
Functions availiable from all controllers - 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: Functions availiable from all controllers (/showthread.php?tid=27799)



Functions availiable from all controllers - El Forum - 02-20-2010

[eluser]Bl4ckB1rD[/eluser]
Where should i put functions to make them availiable in all controllers that i have? Is there a way to call functions from one controller to another controller, so i dont have to copy paste the function's code? Some example would be great.


Functions availiable from all controllers - El Forum - 02-20-2010

[eluser]Sarfaraz Momin[/eluser]
Create Libraries or Helpers as required. Check the Codeigniter documentation for it.

User guide


Functions availiable from all controllers - El Forum - 02-20-2010

[eluser]kgill[/eluser]
Read the user guide this is all covered there.


Functions availiable from all controllers - El Forum - 02-21-2010

[eluser]jedd[/eluser]
[quote author="Bl4ckB1rD" date="1266751698"]Where should i put functions to make them availiable in all controllers that i have? Is there a way to call functions from one controller to another controller, so i dont have to copy paste the function's code? Some example would be great.[/quote]

Better yet, read the [url="/wiki/FAQ"]FAQ[/url] - particularly the first question in the Design section.

Then go and read about [url="/wiki/MY_Controller"]MY_Controller[/url].