Which one has controller structure for api user?
Separate controller for interface and API for each version of api
/app/controllers/UsersController.php
/app/controllers/api/v1/ApiUsersController.php
or
Separate the controller for the interface and API and control the versions in the code
/app/controllers/UsersController.php
/app/controllers/api/ApiUsersController.php
or
Use one controller, detect / api / call inside the router. Return html / json depending on the url.
/app/controllers/UsersController.php
source
share