CakePHP3 Controller without a model


I noticed another user mentioned that they wanted to create a Model-less Controller, however there was not an answer on how-to. I’ve checked the book, I’ve checked all over , no dice. I could always create Views in the DB … but would rather get this done in Cake.

I’ve tried a variety of ways to accomplish this - but haven’t been successful. As for my “why” - I’d like to create indices/navigation elements that are independent of the model - or bring in data from elsewhere similar to a DB view.

Also, functionality that lives outside of the regular site would be implemented this way ( eg: An API + AJAX handlers. )

Some of my database structure does not conveniently fit in a “package” that would make sense in with a (example) “Items” controller to represent it.

If this is possible simply by telling the model I want to work with “none” (preferably) or specify alternate default table(s) … that’s the goal.


You can send a empty response with withStringBody sending an empty string.
Or you can use Json Views if you want generate a view from certain variables


Sorry about that ; my title said view but should have said model like the text.

When I refer to “view” in my message, I’m referring to virtual tables in the rdbms.