Fixes #10581: Add note about overriding get/set methods to behaviors guide

This commit is contained in:
githubjeka
2016-01-15 09:59:31 +03:00
committed by Alexander Makarov
parent 1aee6ddf2a
commit b87999f6bb
2 changed files with 7 additions and 0 deletions

View File

@@ -54,6 +54,9 @@ class MyBehavior extends Behavior
> Tip: Внутри поведения возможно обращаться к компоненту, к которому оно прикреплено, используя свойство > Tip: Внутри поведения возможно обращаться к компоненту, к которому оно прикреплено, используя свойство
[[yii\base\Behavior::owner]]. [[yii\base\Behavior::owner]].
> Note: Если магический метод [[yii\base\Behavior::__get()]] или [[yii\base\Behavior::__set()]] будет переопределен в
унаследованном поведении, то также необходимо переопределить методы [[yii\base\Behavior::canGetProperty()]] и [[yii\base\Behavior::canSetProperty()]]
соответственно. Это должно быть сделано для надлежащего функционирования.
Обработка событий компонента Обработка событий компонента
------------------------- -------------------------

View File

@@ -50,6 +50,10 @@ Because this class is a behavior, when it is attached to a component, that compo
> Tip: Within a behavior, you can access the component that the behavior is attached to through the [[yii\base\Behavior::owner]] property. > Tip: Within a behavior, you can access the component that the behavior is attached to through the [[yii\base\Behavior::owner]] property.
> Note: If a magic method of [[yii\base\Behavior::__get()]] or [[yii\base\Behavior::__set()]] has been overridden in a
child behavior then need to override [[yii\base\Behavior::canGetProperty()]] and [[yii\base\Behavior::canSetProperty()]]
methods respectively too. This must be done to ensure proper functioning.
Handling Component Events Handling Component Events
------------------ ------------------