Welcome Guest, Not a member yet? Register   Sign In
Making data available in ALL views
#7

(06-15-2021, 01:21 AM)InsiteFX Wrote: In your BaseController just load the helper through the helpers array
Then in your view just do this.

PHP Code:
<?= siteinfo();?>

Make sure that your helper is named siteinfo_helper.

Ok, so I changed the view code to what you said and then I removed the code from the Base Controller that calls the helper and moved it up into the array like so:
Code:
protected $helpers = ["form", "auth", "phone", "text","siteinfo"];
When I load the view I am still getting:
Code:
Undefined variable $siteInfo
Reply


Messages In This Thread
RE: Making data available in ALL views - by SoccerGuy3 - 06-15-2021, 07:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB