TP5 中使用 \think\Hook::add('xx', '\app\xxx\behavior\Xx') 注册行为。

也可以在 application/tags.php 中统一注册。

 

在需要监听执行的任何地方使用 \think\Hook::listen('xx', $params) 即可。

 

Refer:ThinkPHP_Hook

Doc: https://www.kancloud.cn/manual/thinkphp5/118130

Link:https://www.cnblogs.com/farwish/p/14673786.html

相关文章:

  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2021-08-30
  • 2021-06-24
  • 2021-10-29
猜你喜欢
  • 2021-08-19
  • 2021-08-16
  • 2021-07-19
  • 2022-12-23
  • 2021-07-08
  • 2021-06-22
相关资源
相似解决方案