Dear all, I am working a app backend using Phalcon.
I always return a json result to http request, I wonder which way is more appropriate below?
Which one is better?
First way
There is no return
public function someAction() {
//do something
$this->response->setStatusCode(200, 'OK');
$this->response->setJsonContent(['some' => 'value']);
$this->response->send();
}
Second way
There is return
send
public function someAction() {
//do something
$this->response->setStatusCode(200, 'OK');
$this->response->setJsonContent(['some' => 'value']);
return $this->response->send();
}