Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 FuelPHP 中使用 Controller_REST 时,我不能使用 \Response,因为 REST 控制器有自己的响应函数,使用 $this->response...
但是当我执行这个函数并传递一个正文和一个响应代码时。
$this->response(array("Missing Parameter"), 400);
就像这样,这实际上并没有结束执行并且调用它的函数继续进行。如果我使用
exit;
响应已损坏。有谁知道为什么会发生这种情况或者它是一个错误?
尝试使用return;而不是exit;. 通常,如果您的业务逻辑,您不想停止一切,只想停止执行。
return;