Welcome Guest, Not a member yet? Register   Sign In
How to use public variables from controller in views in CI 4
#12

(12-30-2020, 07:12 AM)ciddict Wrote: @John_Betong, I'm really sorry to say that I didn't understand what you mean. 

@includebeer, thanks for your suggestion. But in this case, I'll have to pass $this->data with every view(). And beside this, I couldn't use $this->my_variable in views. Which I've in CI3.

Even if you have 50 views, how hard is it to pass $this->data to all your view and use $my_variable instead of $this->my_variable? Do you really think that converting a CI3 application to CI4 is just 2-3 fix here and there that you can do in 5 minutes? Do it the right way or don't do it at all. I don't know what development experience you have, but this is super easy to do and this is how you should have done it even in CI3.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
RE: How to use public variables from controller in views in CI 4 - by includebeer - 12-30-2020, 07:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB