💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### 空操作 当我们访问了一个不存在的操作方法,就会触发空操作检查,还是用上面的例子,我们定义一个_empty方法, ~~~ <?php namespace app\index\controller; class Index { public function helloAction() { return 'hello'; } public function publicAction() { return 'public'; } public function test() { return 'test'; } public function _empty($method) { return '当前操作名:'.$method; } } ~~~ 再次访问 > http://tp5.com/index/index/test 的时候就不会报错了。 页面输出结果是: 当前操作名:test 空操作方法的参数就是当前访问的操作名。