Zend Framework 2で次のことを行うためのより良い解決策はありますか:
help/section/5 と help/section.php?id=5 という 2 つの URL が必要です。
この方法は複雑すぎると思います:
'helpSection' => array(
'type' => 'Zend\Mvc\Router\Http\Segment',
'options' => array(
'route' => '/help/section/:id',
'defaults' => array(
'controller' => 'Application\Controller\Help',
'action' => 'section',
),
),
),
'helpSection2' => array(
'type' => 'Zend\Mvc\Router\Http\Segment',
'options' => array(
'route' => '/help/section.php',
'defaults' => array(
'controller' => 'Application\Controller\Help',
'action' => 'section',
),
),
'child_routes' => array(
'query' => array(
'type' => 'Zend\Mvc\Router\Http\Query',
'options' => array(
'defaults' => array(
'id' => ':id'
)
)
),
),
),