Tuesday, February 8, 2022

[FIXED] How to load constants dynamically in Codeigniter?

Issue

I have a table alertTypes. On a callback I need to access this table data.Every hour, website receives more than 1k hits from these callbacks. This makes a lot of db queries which I want to reduce. How can be these alertTypes records made global in constants.php?


Solution

I have found the answer for this. What I did, I created a pre controller (a type of HOOKS in codeigniter ) which loads all the data needed for the processing. It reduces db queries significantly.



Answered By - aarunbhardwaj

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.