|
|
|
@ -3,7 +3,7 @@ Behaviors
|
|
|
|
|
|
|
|
|
|
A behavior (also knows as *mixin*) can be used to enhance the functionality of an existing component without modifying the component's |
|
|
|
|
code. In particular, a behavior can "inject" its own methods and properties into the component, making them directly accessible |
|
|
|
|
via the component itslef. A behavior can also respond to events triggered in the component, thus intercepting the normal |
|
|
|
|
via the component itself. A behavior can also respond to events triggered in the component, thus intercepting the normal |
|
|
|
|
code execution. Unlike [PHP's traits](http://www.php.net/traits), behaviors can be attached to classes at runtime. |
|
|
|
|
|
|
|
|
|
Using behaviors |
|
|
|
|