如何使zend框架2高级路由

i have a difficulty with zendframework 2 routing.

ex i need to make a dynamic route in zf2

/program1 /program2 etc etc. controller the program name is a dynamic name. is there a way we can terminate all undefined routes to one controller/action ?

You can do something like this:

'myroute' => array(
   'type' => 'regex',
       'options' => array(
           'regex' => '/(?<name>.*)',
           'spec' => '/%name%',
           'defaults' => array(
               'controller' => 'My\Controller\Index',
               'action' => 'index',
           ),
       ),
       'priority' => -1
    ) 
),