class Mycomponent extends CComponent
{
public function init()
{
$this->onTestEvent = 'eventHandler';
}
public function onTestEvent(){}
function eventHandler($event)
{
echo "onTestEvent";
}
}
class SiteController extends CController
{
public function actionIndex()
{
$event = new CEvent($this);
Yii::app()->mycomponent->raiseEvent('onTestEvent',$event);
$this->render('index');
}
}
error:
Why?