目标是有两条路线。Zf2儿童路线匹配不起作用
- domain.de/wordWithMinFourLetters
domain.de/wordWithMaxThreLetters
domain.de/stackoverflow
- domain.de/ch
路线1默认动作是业务 路由2的默认操作是国家
问题:
路由2总是执行,我不知道为什么。 我的路由配置有什么错误?
'router' => array(
'routes' => array(
'application' => array(
'type' => 'literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'index',
'action' => 'index'
)
),
'may_terminate' => true,
'child_routes' => array(
'business' => array(
'type' => 'segment',
'options' => array(
'route' => ':business',
'constraints' => array(
'business' => '[a-z]{4,10}'
),
'defaults' => array(
'action' => 'business'
)
)
),
'countries' => array(
'type' => 'segment',
'options' => array(
'route' => ':countries',
'constraints' => array(
'countries' => '[a-z]{2,3}'
),
'defaults' => array(
'action' => 'countries'
)
)
)
)
),
'clear' => array(
'type' => 'literal',
'options' => array(
'route' => '/clear',
'defaults' => array(
'controller' => 'index',
'action' => 'clear'
)
)
),
'sitemap' => array(
'type' => 'literal',
'options' => array(
'route' => '/sitemap',
'defaults' => array(
'controller' => 'index',
'action' => 'sitemap'
)
)
)
)
)
你有一个约束的'slug',我想这应该是'business' /'countries'。 – sroes