CodeIgniter Forums
Calling functions within controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Calling functions within controller (/thread-35125.html)



Calling functions within controller - El Forum - 10-19-2010

[eluser]Tanag[/eluser]
Basically I want to make some functions I would use a lot on different pages, that I can call from any controller rather than copying and pasting the code.

Where should I place these? In the My_Controller? Or should I make some kind of plugin/library?


Calling functions within controller - El Forum - 10-19-2010

[eluser]jppi_Stu[/eluser]
Looking ahead at 2.0, I would ask whether the functions are related in a way that a Library would make sense. If so, do that. If not, a Helper would be the way to go. The ambiguous "Plugin" structure itself won't be supported from 2.0 onward, so at this point no new plugins (as such) should be created.

Libraries and Helpers are where it's at in the new world! Smile


Calling functions within controller - El Forum - 10-20-2010

[eluser]Tanag[/eluser]
Alright thanks, I'll see about making a library I guess.