1、action不存在的时候。

使用场景,比如我们访问一个action不存在。那么默认会走这个空方法。

  1. <?php
  2. namespace app\index;
  3. use think\Controller;
  4. class Base extends Controller
  5. {
  6. protected function _initialize()
  7. {
  8. parent::_initialize(); // TODO: Change the autogenerated stub
  9. echo "base-init"."<br>";
  10. }
  11. /**
  12. * @param $name 空操作
  13. */
  14. public function _empty($name){
  15. echo $name . "不存在";
  16. }
  17. }