I read several Tutorials to create a restful webservice with ZF2. I saw that the last changes how ZF2 handles restful webservices happened in version 2.0.4. The most promising article to get me started was this: http://dustint.com/post/543/getting-started-with-abstractrestfulcontroller
Anyway, I can't get it done, it seems to me, that in RestController.getList() my returned JsonModel is not working like expected. Due to my Debug-call I can recognize that my RestController.getList()-method will be invoked. All related code is in my github-repository here: https://github.com/Jochen1980/EhcServer/blob/master/module/Application/src/Application/Controller/RestController.php
class RestController extends AbstractRestfulController{
public function indexAction(){
Debug::dump("indexAction()");
return new ViewModel();
}
public function getList() {
Debug::dump("getList()");
return new JsonModel(array(
array('name' => 'test'),
array('name' => 'second')
));
}
...
Currently I got this error message: Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "application/rest/get-list"; resolver could not resolve to a file' in C:\xampp\htdocs\EhcServer\vendor\zendframework\zendframework\library\Zend\View\Renderer\PhpRenderer.php on line 499
Thanks in advance!