Yii Framework Forum: What's $this->Owner ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

What's $this->Owner ? Rate Topic: -----

#1 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 15 April 2010 - 09:37 AM

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
0

#2 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

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.
0

#3 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 15 April 2010 - 10:13 AM

perfect... yes i'm playing with nestedtree extension behavior :)
0

#4 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

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") :huh:
0

#5 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 15 April 2010 - 10:21 AM

View Postandy_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") :huh:


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. :P
0

#6 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 16 April 2010 - 02:23 AM

There you go:

http://www.yiiframew...elcase-in-forum

IMHO: IPB sucks!
0

#7 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 16 April 2010 - 06:08 AM

Why isn't out there a Yii powered forum?
0

#8 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 16 April 2010 - 06:12 AM

Because you haven't written one yet. ;)
1

#9 User is offline   yoshi 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 170
  • Joined: 28-February 09
  • Location:Germany

Posted 16 April 2010 - 06:21 AM

View PostMike, on 16 April 2010 - 02:23 AM, said:

IMHO: IPB sucks!


Must agree!! Especially the forums search is driving me nuts! Sorry for OT ::)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users