-
Notifications
You must be signed in to change notification settings - Fork 90
Unable to render template RuntimeException for AbstractRestfulController #3
Comments
I've ran into this issue many times as well and haven't found a good solution. One way to recreate this is to extend the AbstractRestfulController and implement the get() action but not the getList() action. Then when you go to the getList route, you get a "template not found" error instead of a "Method Not Allowed" response like any other framework gives. It doesn't make sense for me to have to create a "module-name/controller-name/get-list.phtml" template for every rest controller I create when I don't even want to implement "getList" functionality. |
I've stumbled across the same problem as I am currently trying to implement a REST API with ZF2. Afte some research I found out that the So in my understanding the
Am I right?! |
Is there a reason why AbstractRestfulController returns an array in the pre-implemented methods instead of an JsonModel object? |
This repository has been closed and moved to laminas/laminas-mvc; a new issue has been opened at laminas/laminas-mvc#34. |
I get an unable to render template error when i do not over-ride the AbstractRestfulController method.
By default, the response code is set and an array is returned which appears to be picked up and rendered using the default render strategy.
Would it be a good idea to set the response content and return the response or is there something I am missing in the configuration.
I would just like some feedback on this before I make a pull request.
Thanks,
James
The text was updated successfully, but these errors were encountered: