zf1 のようなルートを許可する zf2 でルートを作成するにはどうすればよい/:controller/:action/*
ですか?
controller/action/id/1/page/2
やcontroller/action?id=1&page=2
?などのパラメーターに対応できるようにします。
worldなどのパラメータに対応するルートはcontroller/action?id=1&page=2
、ajax リクエストに役立ちます。
したがって、私の現在のコードは、私のmodule.config.phpで次のようになります
return array(
'controllers' => array(
'invokables' => array(
'Support\Controller\Support' => 'Support\Controller\SupportController',
),
),
'router' => array(
'routes' => array(
'support' => array(
'type' => 'segment',
'options' => array(
'route' => '/support[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Support\Controller\Support',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'support' => __DIR__ . '/../view',
),
),