0

I have this route:

 'editRelationship' => array(
                'type'    => 'Segment',
                'options' => array(
                    'route'    => '/editRelationship[/:state]',
                    'constraints' => array(
                        'state' => '[a-zA-Z][a-zA-Z0-9_-]*',
                      ),
                    'defaults' => array(
                         'controller' => 'User\Controller\Admin',
                        'action'        => 'editRelationship',
                    ),
                 ),
 ),

And this is my action controller:

 public function editRelationshipAction() {

    $state = $this->params()->fromRoute('state', null);

    $viewModel = new ViewModel();

    $viewModel->setVariable('state', $state);
    return $viewModel;
}

I try to access the url but whenever I'm accessing it I always get:

The requested URL could not be matched by routing.

May I know what is missing or wrong with my route?

Thanks in advance.

blackbishop
  • 30,945
  • 11
  • 55
  • 76
Dave
  • 205
  • 2
  • 7
  • 22
  • 2
    How are you accessing that route? (URL) – blackbishop May 07 '15 at 10:07
  • As well as the above, you should also add the entire route to your question (if the `editRelationship` route is a child of another it might change your answer) – AlexP May 07 '15 at 10:51
  • Hi! Yes indeed my problem was on my entire route, my created route should be on the childroute. Thanks guys! – Dave May 08 '15 at 01:51

1 Answers1

0

Yes indeed my problem was on my entire route, my created route should be on the childroute.

Dave
  • 205
  • 2
  • 7
  • 22