Issues

ZF2-452: Default Controller/Action 404 Error

Description

When you setup a Module and configure the route (See Example)

Example

'manage' => array( 'type' => 'segment', 'options' => array( 'route' => '/manage[/:action]', 'constraints' => array( 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', ), 'defaults' => array( 'controller' => 'Manage\Controller\Manage', 'action' => 'index', ), ), ),

If the default action does not exist, a blank page is rendered. I would expect a 404 error message.

In the error log you are presented with the following: PHP Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "manage/manage/index"; resolver could not resolve to a file' in /backup/domains/devel/vendor/Zend/View/Renderer/PhpRenderer.php:451 Stack trace:

0 /backup/domains/devel/vendor/Zend/View/View.php(203): Zend\View\Renderer\PhpRenderer->render(Object(Zend\View\Model\ViewModel))

1 /backup/domains/devel/vendor/Zend/View/View.php(230): Zend\View\View->render(Object(Zend\View\Model\ViewModel))

2 /backup/domains/devel/vendor/Zend/View/View.php(196): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))

3 /backup/domains/devel/vendor/Zend/Mvc/View/Http/DefaultRenderingStrategy.php(128): Zend\View\View->render(Object(Zend\View\Model\ViewModel))

4 [internal function]: Zend\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Zend\Mvc\MvcEvent))

5 /backup/domains/devel/vendor/Zend/EventManager/EventManager.php(469): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

6 in /backup/domains/devel/vendor/Zend/View/Renderer/PhpRenderer.php on line 451

Comments

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2519