Where to put custom settings in Zend Framework 2?

前端 未结 4 1490
有刺的猬
有刺的猬 2021-02-04 10:47

I have some custom application specific settings, I want to put in a configuration file. Where would I put these? I considered /config/autoload/global.php and/or local.php. But

4条回答
  •  长情又很酷
    2021-02-04 11:07

    If you look in config/application.config.php it says:

    'config_glob_paths'    => array(
        'config/autoload/{,*.}{global,local}.php',
    ),
    

    So ZF2 by default will autoload configuration files from config/autoload/ - so for example you could have myapplication.global.php it would get picked up and added into the configuration.

    Evan.pro wrote a blog post that touches on this: https://web.archive.org/web/20140531023328/http://blog.evan.pro/environment-specific-configuration-in-zend-framework-2

提交回复
热议问题