I have some controllers in my Cake application, namely servers and users . I want to write a simple API and have a controller called ApiController . Inside this controller, I want to use the servers and users models.
I am very new to Cake, but not MVC at all. From what I have taken so far, Cake automatically uses the servers model in the ServersController , I donβt know how to explicitly use the model from a specific controller.
In addition, I want API requests to serve only JSON without any HTML markup. I have a default layout that defines the header / footer of all the pages of my site and which is displayed when I request the API function, as well as JSON from the view. How can I stop layout output and instead just view the view?
source share