mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-09 09:36:56 +01:00
22 lines
347 B
PHP
22 lines
347 B
PHP
<?php
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class TestBehavior extends CBehavior
|
|
{
|
|
public function events()
|
|
{
|
|
return array(
|
|
'onTestEvent' => 'handleTest',
|
|
);
|
|
}
|
|
|
|
public function handleTest($event)
|
|
{
|
|
if (!($event instanceof CEvent)) {
|
|
throw new CException('event has to be instance of CEvent');
|
|
}
|
|
$this->owner->behaviorEventHandled++;
|
|
}
|
|
} |