💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
> 在控制器中继承 Base 类,该类继承了 Yaf\Controller_Abstract > 可以通过 使用$this->getRequest()来获取Yaf框架定义的当前请求对象 [TOC] ## 当前的请求类型 方法返回的请求类型始终是大写 ``` $this->method() ``` ## 是否AJAX请求 ``` $this->isAjax() ``` ## 是否JSON请求 ``` $this->isJson() ``` ## 是否PATCH请求 ``` $this->isPatch() ``` ## 是否DELETE请求 ``` $this->isDelete() ``` ## 是否GET请求 ``` $this->isGet() ``` ## 是否HEAD请求 ``` $this->isHead() ``` ## 是否ClI请求 ``` $this->isCli() ``` ## 是否Options请求 ``` $this->isOptions() ``` ## 是否POST请求 ``` $this->isPost() ``` ## 是否PUT操作 ``` $this->isPut() ``` ## 检测是否使用手机访问 $this->isMobile()