Blogger Information
Blog 91
fans 2
comment 4
visits 127838
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
thinkphp5 behavior钩子的使用
夏日的烈风的博客
Original
2189 people have browsed it
  1. 利用命令行创建控制器,比如创建index\behavior\Check控制器 

    php think make:controller app\index\behavior\Check

  2. 在这个behavior中建立一个tags.php  

    return [
       'CheckAuth' => [                                               //标签
           'app\\index\\behavior\\Test',                      //行为控制器
       ],
    ];

  3. 在你要使用的控制器使用Hook::listen('CheckAuth');    此时listen中的参数就是标签名


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post