目標是有兩條路線。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