Welcome Guest, Not a member yet? Register   Sign In
How to Access Config File Variables Globally in all Views ?
#2

Anything you load in BaseController will be available in all the controllers that extend it. There is also the helper function “config()” which not only fetches a config but can use it immediately, e.g.:

<a href=“https://google.com/maps?key=<?= config(‘SiteConfig’)->googleMapsApiKey ?>”>Click</a>
Reply


Messages In This Thread
RE: How to Access Config File Variables Globally in all Views ? - by MGatner - 11-27-2019, 04:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB