I want to bundle the whole error handling in one module. It's working so far, but the error template is still the default [project root]/module/Application/view/error/index.phtml
. I want to use it, but wrapped by my additional code. For this I need to add the default exception template as a partial. It's not possible (anymore) to pass the module name to the Partial view helper. So I tried this (suggested here):
[project root]/module/ErrorHandling/view/exception.phtml
echo $this->partial('Application/error/index');
But it didn't work:
Zend\View\Exception\RuntimeException: Zend\View\Renderer\PhpRenderer::render: Unable to render template "Application/error/index"; resolver could not resolve to a file in /var/www/.../my-project/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php:494
It works only for views from the /module/{AnotherModule}/view/{another-module}
subfolders.
How to get a view from another module (but outside the /module/{AnotherModule}/view/{another-module}
subfolder) rendered as a partial?