Helpers loading with each include statement |
(08-09-2021, 03:59 PM)SoccerGuy3 Wrote: It just dawned on me that those should be individual functions and each called where they are needed. My thought process was backwards on this. I was thinking I was calling this once and loading a "variable" with the information when in fact I am calling this function/helper every time I display one of the elements. Then maybe a library would be better for this use case. You can load the info in a member variable of your class and if you call it again later, you can use the same instance of the library, so it doesn't need to get the data from the database. It would just return the data stored in memory. Of course this is only true if you need the same info in the same execution cycle.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Messages In This Thread |
Helpers loading with each include statement - by SoccerGuy3 - 08-09-2021, 02:05 PM
RE: Helpers loading with each include statement - by includebeer - 08-09-2021, 03:55 PM
RE: Helpers loading with each include statement - by SoccerGuy3 - 08-09-2021, 03:59 PM
RE: Helpers loading with each include statement - by includebeer - 08-09-2021, 05:03 PM
RE: Helpers loading with each include statement - by donpwinston - 08-10-2021, 03:14 AM
RE: Helpers loading with each include statement - by includebeer - 08-10-2021, 04:16 AM
RE: Helpers loading with each include statement - by SoccerGuy3 - 08-10-2021, 08:06 AM
RE: Helpers loading with each include statement - by SoccerGuy3 - 08-10-2021, 09:08 AM
|