// ./module/Editor/config/module.config.php
return [
'router' => [
'routes' => [
'editor' => [
'type' => 'Segment',
'options' => [
// Change this to something specific to your module
'route' => '/editor[/:action][/][:id]', // <- notice it's 'editor' here
'defaults' => [
'controller' => Controller\EditorController::class,
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
// You can place additional routes that match under the
// route defined above here.
],
],
],
],
]
// ./module/Editorvote/config/module.config.php
return [
'router' => [
'routes' => [
'editorvote' => [
'type' => 'Segment',
'options' => [
// Change this to something specific to your module
'route' => '/editorvote[/:action][/][:id]', //<- start with editor***
'defaults' => [
'controller' => Controller\EditorvoteController::class,
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
// You can place additional routes that match under the
// route defined above here.
],
],
],
],
]
open http://localhost/editorvote with browser, the request was dispatched to editor module( $routeMatch->getMatchedRouteName() produce editor) , but if we change ./module/Editor/config/module.config.php:
return [
'router' => [
'routes' => [
'editor' => [
'type' => 'Segment',
'options' => [
// Change this to something specific to your module
'route' => '/editorX[/:action][/][:id]', //<-change 'editor' to 'editorX'
'defaults' => [
'controller' => Controller\EditorController::class,
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
// You can place additional routes that match under the
// route defined above here.
],
],
],
],
]
open http://localhost/editorvote with browser, the request was dispatched to editor module(
$routeMatch->getMatchedRouteName()
produceeditor
) , but if we change./module/Editor/config/module.config.php
:open http://localhost/editorvote , the dispatch works perfectly.
composer.lock: