I have the following route defined

                    'campaigns' => array(
                        'type'    => 'Zend\Mvc\Router\Http\Literal',
                        'options' => array(
                            'route'    => 'campaigns',
                            'defaults' => array(
                                'controller' =>
'Application\Controller\Campaigns',
                                'action'     => 'index',
                            ),
                        ),
                        'may_terminate' => true,
                        'child_routes' => array(
                            'create' => array(
                                'type'  => 'Zend\Mvc\Router\Http\Literal',
                                'options' => array(
                                    'route'  => '/create',
                                    'action' => 'create',
                                ),
                            ),
                            'profile' => array(
                                'type'    => 'Zend\Mvc\Router\Http\Segment',
                                'options' => array(
                                    'route'    => '/:campaign-slug',
                                    'defaults' => array(
                                        'action' => 'campaign',
                                    ),
                                ),
                                'may_terminate' => true,
                                'child_routes' => array()
                        ),

My problem is the way I'm understanding it if I type in /campaigns/create
it should map to /create and if I enter anything else
/campaigns/foofoobunny that should match the /:campaign-slug route. Problem
is that it doesn't work, why is this? How could I make it so if I define an
explicit route it will match and if it doesn't it falls back to this
default dynamic route?

Reply via email to