I am impressed by the flexibility of Yii events. I am new to Yii and I want to know how to pass parameters to Yii event handlers?
//i have onLogin event defined in the login model
public function onLogin($event)
{
$this->raiseEvent("onLogin", $event);
}
I have a login handler defined in the handler class. This event handler method takes a parameter:
function loginHandler($param1)
{
...
}
But here, I am confused as to how to pass a parameter to the login event handler:
//i attach login handler like this.
$loginModel->onLogin = array("handlers", "loginHandler");
$e = new CEvent($this);
$loginModel->onLogin($e);
Am I doing something wrong? Is there another approach for this?