Good day. This question. In the base controller I send the response manually. It seems this all has to stop, but after that, this same response is overwritten in the destination controller. Example:
class RestController extends \Phalcon\Mvc\Controller
{
public function initialize()
{
return $this->response->setStatusCode(400)->setJsonContent(['errors' => 'Token is null'])->send();
}
}
class TestController extends \Controller\RestController
{
public function getTestAction()
{
return $this->response->setStatusCode(200)->setJsonContent(['Controller']);
}
}
The resulting display is ["Controller"]. Although this design worked in version 1.3.5.