2

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?

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
Aran
  • 3,298
  • 6
  • 32
  • 33

1 Answers1

4

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

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636