class Controller_Links extends Controller_Rest { public function post_add() { // Some code ... $this->response(array('result' => $response->result, 'message' => $response->message)); } }
$this->auto_render = false;
class Controller_Links extends Controller_Template { public function action_add() { // Disable the template $this->auto_render = false; // Some code ... // And output $this->request->body = Format::factory(array('result' => $response->result, 'message' => $response->message))->to_json(); } }
It looks like you're new here. If you want to get involved, click one of these buttons!