mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 22:09:48 +08:00
Merge pull request #3359 from tsvetann/patch-4
Update concept-behaviors.md
This commit is contained in:
@@ -184,7 +184,7 @@ class MyBehavior extends Behavior
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The above code defines the behavior class `app\components\MyBehavior` which will provides two properties
|
The above code defines the behavior class `app\components\MyBehavior` which will provide two properties
|
||||||
`prop1` and `prop2`, and one method `foo()` to the component it is attached to. Note that property `prop2`
|
`prop1` and `prop2`, and one method `foo()` to the component it is attached to. Note that property `prop2`
|
||||||
is defined via the getter `getProp2()` and the setter `setProp2()`. This is so because [[yii\base\Object]]
|
is defined via the getter `getProp2()` and the setter `setProp2()`. This is so because [[yii\base\Object]]
|
||||||
is an ancestor class of [[yii\base\Behavior]], which supports defining [properties](concept-properties.md) by getters/setters.
|
is an ancestor class of [[yii\base\Behavior]], which supports defining [properties](concept-properties.md) by getters/setters.
|
||||||
|
|||||||
Reference in New Issue
Block a user