We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mdmunir say
Event::$data not used like that. Its only receive value from on() method. http://www.yiiframework.com/doc-2.0/yii-base-event.html#$data-detail Create your own event class.
class MyEvent extends Event { public $params; }
// ############ $this->on('event_name',function($event){ echo $event->params; });
$this->trigger('event_name',new MyEvent(['params'=>'param value']));
If you using Event::$data, its always set to value of parameter on(). http://www.yiiframework.com/doc-2.0/yii-base-component.html#on()-detail
1, $this->trigger(self::EVENT_POSITION_UPDATE, new Event([ 'data' => $this->_positions[$position->getId()], ])); 本来想在论坛里问,可是忘了密码了,试了好久都验证码不对,找不回密码 请问上面的用法对不,为什么data为null,取不到数据
I was going to ask in the forums, but I forgot the password
Trying for a long time, the verification code is wrong, I can't get my password back
the above code,is that right? The value of the 'data' is null,
I can't get the values of variables
2, $this->on(self::EVENT_POSITION_PUT, ['frontend\compoments\Evee','aa'],$this->_positions[$position->getId()]);
像这样用的话是取的到的 In the examples above,I can get the value of the variable
The text was updated successfully, but these errors were encountered:
Fixed in version v.1.2.0 by adding CartActionEvent class, thanks
Sorry, something went wrong.
No branches or pull requests
mdmunir say
Event::$data not used like that. Its only receive value from on() method. http://www.yiiframework.com/doc-2.0/yii-base-event.html#$data-detail
Create your own event class.
class MyEvent extends Event
{
public $params;
}
// ############
$this->on('event_name',function($event){
echo $event->params;
});
$this->trigger('event_name',new MyEvent(['params'=>'param value']));
If you using Event::$data, its always set to value of parameter on(). http://www.yiiframework.com/doc-2.0/yii-base-component.html#on()-detail
1, $this->trigger(self::EVENT_POSITION_UPDATE, new Event([
'data' => $this->_positions[$position->getId()],
]));
本来想在论坛里问,可是忘了密码了,试了好久都验证码不对,找不回密码
请问上面的用法对不,为什么data为null,取不到数据
I was going to ask in the forums, but I forgot the password
Trying for a long time, the verification code is wrong, I can't get my password back
the above code,is that right? The value of the 'data' is null,
I can't get the values of variables
2,
$this->on(self::EVENT_POSITION_PUT, ['frontend\compoments\Evee','aa'],$this->_positions[$position->getId()]);
像这样用的话是取的到的
In the examples above,I can get the value of the variable
The text was updated successfully, but these errors were encountered: