CodeIgniter Forums
Config helper function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forum-31.html)
+--- Thread: Config helper function (/thread-71990.html)



Config helper function - superior - 10-23-2018

Hello,

In the previous version (3.x) you could call a config item by calling it like "config_item('somevar');" but in CI4 I cannot find it (or me is stupid)..

Did this change, and do we need to work around it, or is it just calling the config in the controller because it's not autoloaded by default? By the way i'm talking about the main config.

Thanks in advance!

Edit:
Stupid me, you can do this via https://bcit-ci.github.io/CodeIgniter4/general/configuration.html (.env explanation).
Solved this by adding it to the .env file and call it with "getenv('somevar')"