Welcome Guest, Not a member yet? Register   Sign In
How do you access the $this bound data of the controller in the view? Ci3 is OK, ci4
#1

How do you access the $this bound data of the controller in the view? Ci3 is OK, ci4 doesn't seem to work

souch as ci3's get_instance()

I can use the global $this anywhere in the controller, model, view in CI3, but ci4, I can't use the global $this in the view, the model, which worries me

get_instance is not available because there is no "super object" aka singleton is present in ci4.

but , in Ci4 'view and model or other , How do I get $this?

I want to write some PHP code in view, which is more convenient,If I don't get $this, all the data can only pass into the view in the echo view ($data) value of the controller, which will be too inconvenient. Is there any way?
Reply


Messages In This Thread
How do you access the $this bound data of the controller in the view? Ci3 is OK, ci4 - by miaojun - 10-13-2017, 07:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB