是否可以读取控制器内的Zend_Application配置变量?

Bil*_*eal 1 php zend-framework

我想要有类似的东西

webmasterEmail = blah@example.com
Run Code Online (Sandbox Code Playgroud)

如果应用程序在生产模式下运行,ErrorController将发送电子邮件.是否可以将其添加到Zend_Application的.ini文件中并稍后在控制器中检索值?

Phi*_*hil 5

太容易了:)

// return all options as an array
$options = $this->getInvokeArg('bootstrap')->getOptions();

// or, specifically
$webmasterEmail = $this->getInvokeArg('bootstrap')
                       ->getOption('webmasterEmail');
Run Code Online (Sandbox Code Playgroud)