Zend 2: How to override the module configuration file?

How can I override the configuration files found in. /vendor/.../module_name/config/module.config.php?

And no, this one doesn't work for me. I'm not sure why.

+4
source share
1 answer

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

Inside application.config.php it has the following line:

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

As for the ZfcUser module and changing the main route.

In zfcuser.global.php change 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', ), ), ) ) ) ); 
+8
source

Source: https://habr.com/ru/post/1436599/


All Articles