I am using CakePHP 3.1 and trying to render the json index response for User
model. I followed the CakePHP manual page and created index.ctp
under the directory src/Template/Users/json/
, but the file does not get hooked by the controller. I also tried src/View/Users
, which also did not work. Should I specify a file to render or something else? In src/Controller/UsersController.php
, I have index()
method with
$users = $this->paginate('Users'); $this->set(compact('users'));