Zend framework2 zf2-检索';应用程序配置';在';ActionController';

Zend framework2 zf2-检索';应用程序配置';在';ActionController';,zend-framework2,Zend Framework2,我意识到我们从控制器访问应用程序配置的理由不应该太多。但我还是在问。。有办法吗 我真正想做的是掌握 module\u listener\u options->config\u glob\u pathkey…我想@timdev没有理解你的意思,你的问题可以通过以下方式解决: <?php // in a controller (or anything that is ServiceLocatorAware) $config = $this->getServiceLocator()->

我意识到我们从控制器访问
应用程序配置
的理由不应该太多。但我还是在问。。有办法吗

我真正想做的是掌握

module\u listener\u options
->
config\u glob\u path
key…

我想@timdev没有理解你的意思,你的问题可以通过以下方式解决:

<?php
// in a controller (or anything that is ServiceLocatorAware)
$config = $this->getServiceLocator()->get('Config');
$applicationConfig = $this->getServiceLocator()->get('ApplicationConfig');

我认为@timdev没有理解你的意思,你的问题可以通过以下方式解决:

$applicationConfig = $this->getServiceLocator()->get('ApplicationConfig');

奇怪,我想我试过了。但现在它起作用了。我想我一定是丢了衣服什么的。奇怪的是,我想我试过了。但现在它起作用了。我想我一定是丢了衣服什么的。