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.