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

When initialising a model(such as a class called Mall), I can pass a TRUE in the third parameter to automatically connect to the default database. Then a member named mall is assigned to CI_Controller and I can use $this->mall->foo() to use the function defined in the Model.
And I notice that, in the Loader:database(), the 'db' variable is assigned to $CI, which is the CI_Controller super object.

But here comes the question:
In the model I can still use $this->db-> to get access to DB handler. Does that means that "$this" in a Model refers to CI_Controller? If so, where can I find the detailed definition?

Thanks.
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB