doujiang6944 2011-06-07 13:21
浏览 40
已采纳

application.ini中的模块特定资源配置

Can I config a resource to be different when a specific module is used?

From what I have read in the documentation (example #12) this should be possible. But I have had no luck with it yet.

In detail, I'm trying to set another path for translation files.

resources.translate.adapter = "array"
resources.translate.data = APPLICATION_PATH "/views/languages"
resources.translate.options.scan = "filename"
resources.translate.options.disableNotices = true
resources.translate.options.logUntranslated = false 
mobile.resources.translate.data = APPLICATION_PATH "/modules/mobile/views/languages"

From the docs

Example #12 Configuring Modules

You can specify module-specific configuration using the module name as a prefix or sub->section in your configuration file.

For example, let's assume that your application has a "news" module. The following are INI >and XML examples showing configuration of resources in that module.

  1. [production]
  2. news.resources.db.adapter = "pdo_mysql"
  3. news.resources.db.params.host = "localhost"
  4. news.resources.db.params.username = "webuser"
  5. news.resources.db.params.password = "XXXXXXX"
  6. news.resources.db.params.dbname = "news"
  • 写回答

2条回答 默认 最新

  • duansaoguan7955 2011-06-08 09:18
    关注

    I was missing a module Bootstrap file.

    Added /modules/mobile/Bootstrap.php

    <?php
    
    class Mobile_Bootstrap extends Zend_Application_Module_Bootstrap {
    }
    

    Now things work, and the per module translation also (mentioned in comments on initial post).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改