如何删除被覆盖模块上的路由? [英] How to remove route on overrided module?

查看:60
本文介绍了如何删除被覆盖模块上的路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Composer将zfcUser模块添加到我的项目中,并在模块ZfcUserOverride中覆盖了它.我想要尾部斜杠工作,所以我在重写模块中添加了路由.

I added zfcUser module to my project via Composer and overrided it in the module ZfcUserOverride. I want trailing slash work, so I added route in overrided module.

zfcUserOverride文件module.config.php的内容如下:

<?php
$config = array(
    'view_manager' => array(
        'template_path_stack' => array(
            'zfcuser' => __DIR__ . '/../view',
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'zfcuser' => 'ZfcUserOverride\Controller\UserController',
        ),
    )
);

$config['router']['routes']['zfcuser']['child_routes']['trailing_slash'] = array(
    'type' => 'Literal',
    'options' => array(
        'route' => '/',
        'defaults' => array(
            'controller' => 'zfcuser',
            'action'     => 'index',
        ),
    ),
);

return $config;

我添加了新路径,一切正常.

I added new path, everythin is working correct.

但是,如果我要删除路线怎么办?这该怎么做?我需要像这样的东西:

But what if I want remove route? How to do this? I need somethink like:

$config['router']['routes']['zfcuser']['child_routes']['login'] = null;

请帮助.谢谢.

推荐答案

这里答案.

@Sharikov Vladislav,我想对您说些什么. 在

@Sharikov Vladislav, I want to say something to you. In this question I answered to your question and you choose the correct answer to somebody that just update his answer with my content 10 hours later. I do not want to start a flame war, what I ask is just to be correct to whom used its time to help you.

另外,我认为您必须在此处发布之前使用搜索引擎,您在开发过程的每个步骤都在问一个问题,很显然,您没有为自己寻找解决方案而付出任何努力.

And also I think you must use search engines prior to post here, you are asking a question for every single step of your development process and it is clear you are putting no effort on searching a solution by yourself.

就说..

这篇关于如何删除被覆盖模块上的路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆