Hi, sometimes I find $this->Owner in Yii code. Is "Owner" a sort of a reserved word? What does t mean $this->Owner? Doing a print_r($this->owner) I've seen that it refers to the model (I think...). So $this->owner is a way to call $model from any part of code?
TIA
Danilo
Page 1 of 1
What's $this->Owner ?
#2
Posted 15 April 2010 - 10:11 AM
It depends on context:
http://www.yiiframew...CBehavior#owner
http://www.yiiframew...et#owner-detail
http://www.yiiframew...api/CForm#owner
Obviously, you deal with a behavior attached to a model (CActiveRecordBehavior?).
By using $this->owner you can access model's properties and methods from this behavior.
http://www.yiiframew...CBehavior#owner
http://www.yiiframew...et#owner-detail
http://www.yiiframew...api/CForm#owner
Obviously, you deal with a behavior attached to a model (CActiveRecordBehavior?).
By using $this->owner you can access model's properties and methods from this behavior.
#4
Posted 15 April 2010 - 10:15 AM
Off-topic: is it a forum's bug or a feature? I write "(BIG B)ehavior", but get "behavior" (with a small "b")
#5
Posted 15 April 2010 - 10:21 AM
andy_s, on 15 April 2010 - 10:15 AM, said:
Off-topic: is it a forum's bug or a feature? I write "(BIG B)ehavior", but get "behavior" (with a small "b") 
Yes it's a bug. Somewhere it already got mentioned in this forum. And if I remember right the IPB devs are aware about this. Maybe you can find the thread.
Share this topic:
Page 1 of 1

Help
















