In FuelPHP when using Controller_REST I can't use \Response as REST controller has its own Response functions using $this->response...

But when I execute this function and pass a body and a response code.

$this->response(array("Missing Parameter"), 400);

Like so, this doesn't actually end the execution and the function calling it carries on. If I use

exit;

The Response is broken. Does anyone know why this happens or is it a bug?

有帮助吗?

解决方案

Try using return; instead of exit;. Usually you do not want to stop everything but just the execution if your business logic.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top