zend-framework - Zend Framework - 从 Controller 读取 Application.ini 值

标签 zend-framework web-applications configuration

我正在尝试将我的 Google Maps API key 存储在我的 application.ini 文件中,并且我希望能够在需要时从我的 Controller 中读取它。如何从我的 Controller 中读取 application.ini 中的值?

谢谢!

最佳答案

This文章可能会帮助你。作者解释了如何从 application.ini 文件中检索 gmail 连接参数。

您可能想尝试:

$bootstrap = $this->getInvokeArg('bootstrap');
$aConfig = $bootstrap->getOptions();
googleMapsKey = $aConfig['your_resource']['your_key'];

关于zend-framework - Zend Framework - 从 Controller 读取 Application.ini 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2538519/

相关文章:

zend-framework - Zend Framework : Flash Messenger, 添加来自模型的消息

javascript - 服务 worker 获取事件监听器 : what does it catch?

c# - 使VS2010项目文件提示路径默认为绝对路径?

mysql - Zend数据库连接失败

zend-framework - PHPUnit代码覆盖率显示单元测试的代码覆盖率?

zend-framework - Zend 表单 - 两行元素标签

php - 使用 PHP 将记录写入 .dbf 文件?

jquery - iOS UIWebView 在浏览大约 :blank url 时没有检测到 javascript

django - 使用 nginx 在多台机器和硬盘驱动器上提供静态文件

node.js - 在永远的 JS 配置文件中指定日志记录选项