Чего я пытаюсь достичь:
domain.com/user = UserController::index
domain.com/user/profile = UserController::profile
domain.com/user/profile/9 = UserController::profile (with query param id=9)
domain.com/user/profile/9/edit = UserController::editProfile (with query param id=9)
Итак, у меня есть следующий маршрут:
'user' => array(
'type' => 'Segment',
'options' => array(
'route' => '/user',
'defaults' => array(
'__NAMESPACE__' => 'YrmUser\Controller',
'controller' => 'User',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'profile' => array(
'type' => 'Segment',
'options' => array(
'route' => '/profile[/:id]',
'defaults' => array(
'action' => 'profile',
),
'constraints' => array(
'id' => '[0-9]*'
),
),
'may_terminate' => true,
'child_routes' => array(
'edit' => array(
'type' => 'Segment',
'options' => array(
'route' => '/edit',
'defaults' => array(
'action' => 'editProfile',
),
),
'may_terminate' => true
),
)
),
)
)
Это работает, за исключением того факта, что идентификатор параметра запроса никогда не получает значения. Любой, кто может сказать мне, что я делаю неправильно, я догадываюсь, что это что-то глупо простое...
Заранее спасибо,
Юрм