public on ( string $name, callable $handler, mixed $data = null, boolean $append = true ) | ||
$name | string | the event name |
$handler | callable | the event handler |
$data | mixed | the data to be passed to the event handler when the event is triggered. When the event handler is invoked, this data can be accessed via [[Event::data]]. |
$append | boolean | whether to append new event handler to the end of the existing handler list. If false, the new handler will be inserted at the beginning of the existing handler list. |