Zend framework2 如何从zend framework2中的url中删除控制器名称和操作名称

Zend framework2 如何从zend framework2中的url中删除控制器名称和操作名称,zend-framework2,Zend Framework2,我的url似乎是: 我想成为: 这怎么可能 router.config.php添加了 'new' => array( 'type' => 'segment', 'options' => array( 'route' => '/[/:id][/:pId]', 'constraints' => array(

我的url似乎是:

我想成为:

这怎么可能

router.config.php添加了

'new' => array(

    'type' => 'segment',
                'options' => array(
                    'route' => '/[/:id][/:pId]',
                    'constraints' => array(
                        'id' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'pId' => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Application\Controller\New',
                        'action' => 'index',
                    ),
                ),
            ),
controllers.config.php

'controllers' => array(

    'invokables' => array(
            'Application\Controller\New' => 'Application\Controller\NewController'
        ),
    ),

我确实在Zend做了一些项目,但正如我所记得的,这将是关于路线的

检查一下StackOverflow的这个问题和答案,这里有一个很好的解释,也许可以指导您


我可以看看你的router.config.php吗?我实际上不知道在router.config.php中为上述内容写些什么……你能尝试使用'route'=>'/:id/:pId'吗,