Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter.com - Report problems!
#61
Sad 

(03-09-2022, 12:27 AM)InsiteFX Wrote: CodeIgniter 4 uses Events instead of Hooks. So you want to read up on the CodeIgniter 4 Event system.

Hello, Thanks for the help, I understand now how it works, but I am trying to get these settings available globally, 

Code:
ErrorException
Creating default object from empty value
APPPATH/Config/Events.php at line 58

52 Events::on('pre_system', static function () {
53    $configs = Database::connect()
54                    ->query('SELECT * FROM setting ')
55                    ->getResult();
56    foreach($configs as $config)
57    {
58        config($config->setting_type)->{$config->name} = $config->value;
59    }
60 });

I have theese three fields in my table seting_type has simmilar value, name and value has respective value. could you plese tell me what I am doing wrong here?
Reply
#62

Please read this.

CodeIgniter 4 User Guide -> Generating Query Results -> Result Arrays
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#63

(03-10-2022, 01:03 AM)InsiteFX Wrote: Please read this.

CodeIgniter 4 User Guide -> Generating Query Results -> Result Arrays

Thanks! I've looking for this for a while now
Reply
#64

thanks
Reply
#65

Report problem is a necessity to monitor and can fix for next time 
fleeing the complex
Reply
#66

Why are there some irrelevant posts under this thread?
Reply
#67

(01-19-2023, 12:36 AM)demyr Wrote: Why are there some irrelevant posts under this thread?

There are irrelevant posts in all threads and mods are OK with that (answering or ignoring them).
Reply
#68

(This post was last modified: 06-22-2023, 05:46 PM by kenjis.)

This is the thread for reporting problems with the site https://codeigniter.com/.

Please do not post anything irrelevant to this thread.
If you do post, you will be banned.
Reply
#69

(This post was last modified: 08-31-2023, 10:15 PM by kenjis.)

This is where you report problems with the official website (https://codeigniter.com/).

Please do not post anything irrelevant to this thread.
If you do post, you will be banned.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB