I am a begging with ZF2. I try to do a router and when I use in View. I have this error : Fatal error: Uncaught exception 'Zend\Mvc\Router\Exception\RuntimeException' with message 'Route with name "documents" not found'
Can you help me?
This is my code :
<?php
return array(
'controllers' => array(
'invokables' => array(
'Documents\Controller\Documents' => 'Documents\Controller\DocumentsController',
),
),
'router' => array(
'routes' => array(
'documents' => array(
'type' => 'segment',
'options' => array(
'route' => '/DocumentsController[/:action]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
'__NAMESPACE__' => 'Documents\Controller',
'controller' => 'Documents\Controller\DocumentsController',
'action' => 'add',
),
)
)
)
)
);
Thanks