excuse me
<?php
use Phalcon\Mvc\Controller;
class ApiController extends Controller {
public function machineAction() {
$this->jsonAction(['code' => '0']);
}
public function notfoundAction() {
$this->response->setContentType('application/json', 'UTF-8');
$this->response->setJsonContent(['code' => '0']);
return false;
}
public function jsonAction($param) {
$this->response->setContentType('application/json', 'UTF-8');
$this->response->setJsonContent($param);
return false;
}
}
/api/machine not work
/api/notfound is ok
I try to read https://docs.phalcon.io/zh/3.3/api/Phalcon_Http_Response
but nothing to help me