[TP5] 浅谈 ThinkPHP 的 Hook 行为事件及监听执行

TP5 中使用 \think\Hook::add('xx', '\app\xxx\behavior\Xx') 注册行为。 也可以在 application/tags.php 中统一注册。 在需要监听执行的任何地方使用 \think\Hook::listen('xx', $params) 即可。 Re

posted on 2021-04-18 16:24  ercom  阅读(1358)  评论(0编辑  收藏  举报