Browse Source

Merge pull request #10021 from musay/patch-1

Update concept-behaviors.md [skip ci]
tags/3.0.0-alpha1
Alexander Makarov 9 years ago
parent
commit
38762539e3
  1. 2
      docs/guide/concept-behaviors.md

2
docs/guide/concept-behaviors.md

@ -46,7 +46,7 @@ The above code defines the behavior class `app\components\MyBehavior`, with two
`prop1` and `prop2`--and one method `foo()`. Note that property `prop2`
is defined via the getter `getProp2()` and the setter `setProp2()`. This is the case because [[yii\base\Behavior]] extends [[yii\base\Object]] and therefore supports defining [properties](concept-properties.md) via getters and setters.
Because this class is a behavior, when it is attached to a component, that component will then also have the the `prop1` and `prop2` properties and the `foo()` method.
Because this class is a behavior, when it is attached to a component, that component will then also have the `prop1` and `prop2` properties and the `foo()` method.
> Tip: Within a behavior, you can access the component that the behavior is attached to through the [[yii\base\Behavior::owner]] property.

Loading…
Cancel
Save