且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Zend 2:如何覆盖模块的配置文件?

更新时间:2022-12-06 12:25:18

尝试将配置文件命名为 filename.global.php 或 filename.local.php.

Try naming the configuration file filename.global.php or filename.local.php.

在 application.config.php 里面有这行:

Inside application.config.php it has this line:

config/autoload/{,*.}{global,local}.php

关于 ZfcUser 模块和更改主路由.

zfcuser.global.php文件底部修改以下内容:

In zfcuser.global.php modify the following at the bottom of the file:

return array(
    'zfcuser' => $settings,
    'service_manager' => array(
        'aliases' => array(
            'zfcuser_zend_db_adapter' => (isset($settings['zend_db_adapter'])) ? $settings['zend_db_adapter']: 'Zend\Db\Adapter\Adapter',
        ),
    ),
    'router' => array(
        'routes' => array(
            'zfcuser' => array(
                'options' => array(
                    'route' => '/member',
                    'defaults' => array(
                        'controller' => 'zfcuser',
                        'action' => 'index',
                    ),
                ),
            )
        )
    )
);