0

I have what I hope is quite a simple question, but it's been taking me a while to figure out...

I have tried to setup a /settings route in Zend. I do not have a module for settings but I have setup the necessary views and controllers within the application module.

I'll cut to the chase.

Here is my code:

        'settings' => array(
            'type' => 'literal',
            'options' => array(
                'route'    => '/settings',
                'defaults' => array(
                    'controller' => 'Application\Controller\Settings',
                    'action'     => 'index',
                ),
            ),
            'may_terminate' => true,
            'child_routes' => array(
                'default' => array(
                    'type'    => 'literal',
                    'options' => array(
                        'route'    => '/edit',
                        'defaults' => array(
                            'action'     => 'edit',
                        ),
                    ),
                ),
            ),
        ),

When I go to /settings/edit it shows the page correctly. If I enter /settings by itself I get a 404 "The requested URL could not be matched by routing."

Is there anything obvious in the syntax above?

Please ask if you need more info on code.

Thank you!

anewvision
  • 105
  • 2
  • 15
  • 2
    Code looks fine. Are you sure it's `/settings` you're testing and not `/settings/`? – Tim Fountain Feb 10 '15 at 18:36
  • Now I feel stupid, you are correct! I think it had taken me so long to get it to that stage that I forgot to check some of the basics..! Thanks for pointing it out. – anewvision Feb 10 '15 at 21:57

1 Answers1

0

As @timfountain pointed out, was simply including a / on the route and this was breaking it... unbelievable simple/stupid.

anewvision
  • 105
  • 2
  • 15