Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14346

How do you access the $this bound data of the controller in the view? Ci3 is OK, ci4

$
0
0
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?

Viewing all articles
Browse latest Browse all 14346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>