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.
- [production]
- news.resources.db.adapter = "pdo_mysql"
- news.resources.db.params.host = "localhost"
- news.resources.db.params.username = "webuser"
- news.resources.db.params.password = "XXXXXXX"
- news.resources.db.params.dbname = "news"
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).