• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.