我想添加crm作为CRM模块的前缀。带前缀的ZF2路由在默认情况下不工作
这是路由器节我module.config.php
'router' => array(
'routes' => array(
'calendar' => array(
'type' => 'segment',
'options' => array(
'route' => '/crm/calendar[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Crm\Controller\Calendar',
'action' => 'index',
),
),
),
当我使用test.dev/crm/calendar/index工作正常。但它不适用于test.dev/crm/calendar。我找不到任何问题。我使用'route' => '/calendar[/:action][/:id]',
我可以使用test.dev/calendar。但我需要使用前缀。我该怎么做?
您的路线配置是正确的,它必须是别的。为什么它'不工作'?你会得到什么错误? – AlexP 2014-09-03 08:15:30
配置无误。因为它在某个网址中工作。当我使用/ crm/calender时,它不会重定向到相关操作。 – 2014-09-03 08:23:06
尝试''route'=>'/ crm/calendar [/:action [/:id]]'' – Xerkus 2014-09-03 10:14:09