5.0.0 - 普通 - 已关闭
版本: thinkphp 6.0 rc3问题产生:
定义了 event 类,形如
class User
{
public function handle()
{
dump(__METHOD__);
}
}在 event.php 中绑定'bind' => [
'users' => app\event\User::class,
],执行:event('users')
结果是无法执行。
看了源代码,发现 bind 数组解析出来的事件还需要到 listeners 数组查找,这当然解析不出来,为何需要这么做还是说是 BUG?事件和事件监听从文档来看,是两种形式,为何在源代码中 event bind 的事件需要 listeners 数组?
