ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
1.hook钩子与行为 通过配置文件执行钩子行为 ![](https://img.kancloud.cn/09/ca/09ca754029566f65712f077ad0868745_762x384.png) ``` public function index(){ Hook::listen('test'); echo cache('name3'); } ``` ``` <?php namespace app\index\controller; use think\Controller; class A{ public function run(){ $this->a1(); $this->b1(); $this->c1(); } public function a1(){ cache('name1',1); } public function b1(){ cache('name2',2); } public function c1(){ cache('name3',3); } } ```