Welcome Guest, Not a member yet? Register   Sign In
What does $this refer to in a Model?
#3

(01-28-2016, 10:31 AM)Narf Wrote: No, $this always refers to the instance of the class you are currently in.

You can access controller properties because of a magic __get() method: https://github.com/bcit-ci/CodeIgniter/b...el.php#L71

I know that $this refers to the most direct class, but how to explain that in a Model, $this can call the function or variable of CI_Controller?
Reply


Messages In This Thread
RE: What does $this refer to in a Model? - by dangyuluo - 01-28-2016, 07:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB