I created a ZF2 REST web service, starting from the ZF2 Skeleton Application.
I've created my own module, with my routes and a view strategy of ViewStrategyJson
.
What I want to do is to remove the default "Application" module, so that the only module in my application is my own custom module, for my REST service.
I tried removing "Application" from the list of modules in application.config.php
, making this change:
'modules' => array(
'Application',
'RestModule',
),
'modules' => array(
'RestModule',
),
However, when I do this, all requests to my REST module now give me this error:
Fatal error:
Uncaught exception 'Zend\View\Exception\RuntimeException' with message:
'Zend\View\Renderer\PhpRenderer::render: Unable to render template "error";
resolver could not resolve to a file' in /opt/lampp/htdocs/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php:499
Stack trace:
#0 /opt/lampp/htdocs/vendor/zendframework/zendframework/library/Zend/View/View.php(205): Zend\View\Renderer\PhpRenderer->render(Object(Zend\View\Model\ViewModel))
#1 /opt/lampp/htdocs/vendor/zendframework/zendframework/library/Zend/View/View.php(233): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#2 /opt/lampp/htdocs/vendor/zendframework/zendframework/library/Zend/View/View.php(198): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#3 /opt/lampp/htdocs/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/DefaultRenderingStrategy.php(102): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#4 [internal function]: Zend\Mvc\View in /opt/lampp/htdocs/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php** on line 499
I feel like I must be missing something, somewhere, but I can't seem to find it. I would love some help/suggestions. Thanks.