这里的顶级路由器有效。/property 是一个字面量路由,它不会终止并在子路由上执行 GET 操作。在此之下,我有一个段路由,就像它的父级一样,它不会终止并在子路由上执行 GET 操作。它应该只在 /property/12 上响应 GET 请求
在那里路由时出现未找到的错误。
'router' => array(
'routes' => array(
'property' => array(
'type' => 'Literal',
'options' => array(
'route' => '/property',
),
'may_terminate' => false,
'child_routes' => array(
'get' => array(
'type' => 'method',
'options' => array(
'verb' => 'GET',
'defaults' => array(
'controller' => 'Property\Controller\Rest',
'action' => 'get',
),
),
),
'by_id' => array(
'type' => 'segment',
'options' => array(
'route' => '/[:propertyId]',
'may_terminate' => false,
'child_routes' => array(
'get_by_id' => array(
'type' => 'method',
'options' => array(
'verb' => 'GET',
'defaults' => array(
'controller' => 'Property\Controller\Rest',
'action' => 'getById',
),
),
),
)
),
),