As part of my project, I created a "main" directory that contains specific classes and methods, called in all controllers. I defined the configuration options in my bootstrap file as follows:
private function loadConfig () { // Bootstrap $configFile = __DIR__ . '/../config/config.json'; // Create the new object $config = json_decode ( file_get_contents ( $configFile ) ); // Store it in the Di container $this->di->setShared ( 'config', $config ); }
I want to have access to these configuration values โโin my โcoreโ classes.
What should I do?
source share