-
Notifications
You must be signed in to change notification settings - Fork 91
InjectTemplateListener return proper api template #164
Conversation
…th true in config route This way we can set controller_map and as a result ,apigility will return proper api template
Please provide a test; i don't fully interstage what the patch is trying to accomplish. |
This patch is to solve issues like : #3 |
Just to clarify, #3 is about how the the AbstractRestfulController looks for templates and returns "500 internal server error" for undefined methods rather than returning "405 method not allowed". Does this fix that? |
It will fix the problem with returning of proper template ... . when using rest API controller This way the inject listener will detect what template you want for your API From comments - #3 " 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. " |
Closing in favor of #163, which also incorporates the same commits. |
InjectTemplateListener return proper api template if prefer_route_match_controller is set to true from route config.This way we can set controller_map and as a result ,apigility will return proper api template ,instead to look for template zf/rest/action.phtml ( get-list.phtml )