1
I am trying to create a Jsonview response to my application. I followed the steps described in the manual https://book.cakephp.org/3.0/en/views/json-and-xml-views.html, but I keep getting the bug Missing Template, follows the code below:
In the archive Routes.php:
$routes->setExtensions(['json']);
In the archive Appcontroller.php:
$this->loadComponent('RequestHandler');
In the archive Userscontroller.php:
public function fetch() {
$users = $this->Users->find();
$this->set(compact('users'));
$this->set('_serialize', ['users']);
}
When trying to access the url /users/fetch.json i always get Missing Template error. What I might be doing wrong?