public function teste() {
$usuario = $this->Usuarios->newEntity();
$usuario->first_name='Juarez';
$this->set([
'_serialize' => ['json'],
'json' => $usuario,
]);
$this->set('_serialize', true);
}
but response contain layout (ex.: html, header, body, footer the cake debugger, etc), I just want string as a response.
I tryed $this->viewBuilder()->layout(null);
don’t work