Open macnibblet opened 11 years ago
Basically, we have the ability to set Accept criteria via the "accept_criteria" configuration key of each controller. However, this always defaults to the default ViewModel implementation -- which means the default renderer implementation, the PhpRenderer, will be selected.
So, you have a couple of options currently:
The question I have is: should this be a feature of the module? In other words should I have a listener by default, and allow opting-in to it by selected resource controller?
@macnibblet Any comments on the above?
I like the second idea of using a listener and short circuiting with an ApiProblem with appropriate information and a http status code of 406.
Is there any good use case for using a post-check ?
Another interesting issue i found is that angularjs default Content-Type
header is application/xml
which caused some really weird and unexpected behavior and also should be resolved.
I had this strange error with my application just now until i figured out that i was not setting the Accept header.
Exposed message was
Zend\View\Renderer\PhpRenderer::render: Unable to render template "phly-restfully/resource/get"; resolver could not resolve to a file