Yii Framework Forum: Passing Cevent Param To Event Handler - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Passing Cevent Param To Event Handler Rate Topic: -----

#1 User is offline   Mr. Right 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 25-April 14
  • Location:Philippines

Posted 27 April 2014 - 09:53 PM

I just want to pass an event handler to onAfterValidate method of my model but how should I pass parameter to the event handler. I initialized the event handler like this:
$model->onAfterValidate = array(new AnEventClass, 'eventHandler');

How should I pass this CEvent to that handler?
new CEvent($model, array('my_param' => $param_value));


Thanks...
0

#2 User is offline   jkofsky 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 536
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 29 April 2014 - 09:09 PM

View PostMr. Right, on 27 April 2014 - 09:53 PM, said:

I just want to pass an event handler to onAfterValidate method of my model but how should I pass parameter to the event handler. I initialized the event handler like this:
$model->onAfterValidate = array(new AnEventClass, 'eventHandler');

How should I pass this CEvent to that handler?
new CEvent($model, array('my_param' => $param_value));


Thanks...

don't really know. the only $event passing that I know of is in the behaviors
Do, or do not. There is no 'try.' Jedi Master Yoda
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users