Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top