I have a section in ini files with some globally used social links, for ex:
[social]
fb = URL
twitter = URL
linkedin = URL
What's the easiest way to access these, or is there a better way to organize these global variables?
I have a section in ini files with some globally used social links, for ex:
[social]
fb = URL
twitter = URL
linkedin = URL
What's the easiest way to access these, or is there a better way to organize these global variables?
Copyright © 2021 Jogjafile Inc.
If you read your config file upon initialization/bootstraping your application AND store it in the DI container, then it will be accessible through that in every part of your app.
Example - bootstrap
Now you can access this in your controller as such:
Views via Volt:
You can always set that particular part of your config in your views through a base controller.
and then access that variable through your view: