Welcome Guest, Not a member yet? Register   Sign In
Global view variables
#3

Is there a way to pass a variable to a template once for all the routeable methods in a controller? I'm pretty sure there was in CI3 and I also had one in Kohana. Just can't find anything in CI4 documentation for Views. I guess,since templates are just views, this can be done in the controller's __construct method by passing an array of data to the template. But, is there any better way?
Reply


Messages In This Thread
Global view variables - by forumz - 07-04-2021, 03:02 PM
RE: Global view variables - by John_Betong - 07-04-2021, 10:41 PM
RE: Global view variables - by forumz - 07-05-2021, 03:37 AM
RE: Global view variables - by InsiteFX - 07-05-2021, 08:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB