Welcome Guest, Not a member yet? Register   Sign In
Problem in accessing query in construct
#3

(08-08-2021, 01:18 AM)InsiteFX Wrote: Add a method in your BaseController to get the settings.
Example:
PHP Code:
protected function getSettings()
{
    return $this->settings;

Try that.

I tried to add this method in my BaseController, then did a var_dump in the another controller construct function but it returned null anyway.

I think the best workaround to this problem is using the CI4 Filters, but as I fetch all settings from database on BaseController, is there any way to use the data from this fetch instead of fetching it again on Filters?

The reason why I wanted to filter it on construct function is because I'll need to add this kind of filter to many pages individually, so creating Filters I'll need to create too many filters to verify if each page is enabled, is there any way to do this in a more "automatic"?
Reply


Messages In This Thread
RE: Problem in accessing query in construct - by neto737 - 08-08-2021, 03:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB