How do I write a route in zf2 that allows for routes like /:controller/:action/*
in zf1?
So that it can cater for parameters like controller/action/id/1/page/2
and controller/action?id=1&page=2
?
A route that caters for parameters like controller/action?id=1&page=2
world be useful for ajax requests.
So my current code looks like this in my 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',
),
),