CodeIgniter Forums
Universal function - how to organize? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Universal function - how to organize? (/showthread.php?tid=76211)



Universal function - how to organize? - tassman - 04-22-2020

How do you organize something like this: 
There are few function (function use CodeIgniter resources) which are used more than in one place. Do you create something like Universal library or universal controller?


RE: Universal function - how to organize? - jreklund - 04-22-2020

It depends on what resources it are utilizing. Generally speaking it's better to create libraries, as they don't need to be extended. Or you will up with 10 controllers extending each other.

It really depends on what functionality you are using.