Routing zend framework 3路由冲突

Routing zend framework 3路由冲突,routing,zend-framework3,Routing,Zend Framework3,当我们在url中传递故事标题时,我在创建细节页面的路由时遇到了问题。它与我们的类别url路由冲突。所以我需要在url的末尾验证{-storyid} 示例url: {category}在Zend Framework 2+中,您可以为路由添加优先级。更高的优先级意味着,您的路线将先于其他路线处理。你也可以给消极的优先权 module.config.php中的路由需要优先级键,如下所示: 'myroute' => [ 'priority' => 10

当我们在url中传递故事标题时,我在创建细节页面的路由时遇到了问题。它与我们的类别url路由冲突。所以我需要在url的末尾验证{-storyid}

示例url:


{category}

在Zend Framework 2+中,您可以为路由添加优先级。更高的优先级意味着,您的路线将先于其他路线处理。你也可以给消极的优先权

module.config.php中的路由需要优先级键,如下所示:

        'myroute' => [
            'priority' => 10,  // <-- route priority
            'type' => Segment::class,
            'options' => [
                'route' => '/hindi[:/category]',
                'constraints' => [
                    'category' => '[a-zA-Z][a-zA-Z0-9-]*',
                ],
                'defaults' => [
                    'controller' => Controller\IndexController::class,
                    'action' => 'index',
                ],
            ],
        ],

这条路很快,对吗?