You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
Analyse the request method and dispatch to one of the REST methods
Analyse the action returned by the router and dispatch to this
For me, using the latest and greatest versions of both components, this is a problem. For some reason, the router always sets the action key of the RouteMatch, so RESTful actions are never executed.
This it the RouteMatch I get for http://somedomain/:
There's little in the way of documentation for or recent information on AbstractRestfulController so I did this: using the latest version of the skeleton, I added a route to the module config:
However, I also get a Zend\View runtime exception:
Unable to render template "application/ping/get-list"; resolver could not resolve to a file
I added the ViewJsonStrategy to the view manager but still received the same error. Maybe this stopped working way back when renderer selection based on Accept header was removed from those strategies (PR)? Or maybe I'm just not configuring the controller properly. In either case, AbstractRestfulController probably should be updated to use AcceptableViewModelSelector.
A quick Google didn't turn up any recent articles or mentions of AbstractRestfulController. I suspect that people have long since moved on to packages like ZfrRest or zf-rest or even rolling their own (eg: zend-router can do routing based on HTTP Method)
Router does not set parameters on its own, none of the zend-mvc versions have 'index' string either.
It is either from route configuration or some user registered listener in mvc application
The RESTful controller of MVC knows two different behaviours:
action
returned by the router and dispatch to thisFor me, using the latest and greatest versions of both components, this is a problem. For some reason, the router always sets the
action
key of theRouteMatch
, so RESTful actions are never executed.This it the RouteMatch I get for
http://somedomain/
:The respective config is this:
I also tried to overwrite the
index
key deliberately by setting it tobut the RouteMatch always stays the same. Why? Is it me or the code?
Any help is very welcome.
The text was updated successfully, but these errors were encountered: