Zend framework2 带分段的zf2路由问题
我尝试使用多段布线,如下所示 htpro/doc/Appoinces/2014年10月15日Zend framework2 带分段的zf2路由问题,zend-framework2,Zend Framework2,我尝试使用多段布线,如下所示 htpro/doc/Appoinces/2014年10月15日 'doc' => array( 'type' => 'segment', 'options' => array( 'route' => '/doc[/:action][/:app_day][/:app_month][/:app_year]',
'doc' => array(
'type' => 'segment',
'options' => array(
'route' => '/doc[/:action][/:app_day][/:app_month][/:app_year]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
'controller' => 'doc\Controller\Doc',
'action' => 'appointments',
),
),
),
但我得到了以下错误,可能是什么问题
路由无法匹配请求的URL。请尝试以下操作:
'doc' => array(
'type' => 'segment',
'options' => array(
'route' => '/htpro/doc[/:action][/:app_day][/:app_month][/:app_year]', //add /htpro
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'app_day' => '[0-9]*', // add this
'app_month' => '[0-9]*', // add this
'app_year' => '[0-9]*', // add this
),
'defaults' => array(
'controller' => 'doc\Controller\Doc',
'action' => 'appointments',
),
),
),
但是您仍然需要定义您的肋约束。但仍然是相同的问题