💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
# defaultMethod 当控制器方法不存在的时候的默认方法 NormalRoute首先先匹配Controller,如果找不到直接返回404,然后寻找Method,如果找不到则会执行defaultMethod方法。 我们默认提供了一个处理机制。 ```php /** * 当控制器方法不存在的时候的默认方法 */ public function defaultMethod() { if ($this->request_type == SwooleMarco::HTTP_REQUEST) { $this->http_output->set_header('HTTP/1.1', '404 Not Found'); $template = $this->loader->view('server::error_404'); $this->http_output->end($template->render()); } else { throw new SwooleException('method not exist'); } } ``` 如果需要自定义请重写此方法。