Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3456758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:46:35+00:00 2026-05-18T09:46:35+00:00

Reading the section Zend_Application_Resource_Modules in the docs here: http://framework.zend.com/manual/1.10/en/zend.application.available-resources.html I noticed this: You can

  • 0

Reading the section Zend_Application_Resource_Modules in the docs here:
http://framework.zend.com/manual/1.10/en/zend.application.available-resources.html

I noticed this:

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

using this:

  [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"

To me this is a good idea. But, when I simply add these prefixes to certain things I want to be specific to my modules, nothing changes.

So my question is: How do I tell Zend Framework to actually use these module specific prefixes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:46:36+00:00Added an answer on May 18, 2026 at 9:46 am

    I use the following implementation of modules in Zend. It allows you to use “module-specific” configuration.

    application/config/config.ini
    -----------------------------
    [production]
    resources.modules[] =
    

    By doing this, you’re telling Zend_Application that you want to use the Modules Bootstrap Resource plugin. The Modules plugin will load a separate bootsrap class for each of your modules, excluding the default module. Therefore, you need to create a new bootstrap class for your second module.

    application/modules/news/Bootstrap.php
    -----------------------------
    class News_Bootstrap extends Zend_Application_Module_Bootstrap {
    
       //---------------------------------------
       // Automatically load our resources
       //
       // NOTE: You don't have to add this, its
       //       just and example to show that you
       //       can customize the bootstrap
       //       process just for this module.
       public function _initModuleResourceAutoloader(){
    
          $this->getResourceLoader()->addResourceTypes(array(
             'modelResource' => array(
                'path' => 'models/resources',
                'namespace' => 'Resource'
             )
          ));
       }
    }
    

    This “News_Bootstrap” class will now be loaded and executed during the bootstrap process.

    The naming convention for this file is important as the Modules Resource plugin needs to be able to find the class. Note that you must name the file Bootstrap.php.

    Finally, you’ll notice that you’re subclassing the Zend_Application_Module_Bootstrap rather than Zend_Application_Bootstrap_Bootstrap like you do in the main bootstrap.

    Now, your module-specific configuration should work:

    [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"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a bit puzzled reading this: Gcc 4.5 online manual --- Standards section
I am reading chapter 2 of Advanced Linux Programming: http://www.advancedlinuxprogramming.com/alp-folder/alp-ch02-writing-good-gnu-linux-software.pdf In the section 2.1.3
OK thought I understood IDipose but just reading the best practices section of Accelerated
I'm reading through K&R and came to the small section on register variables, and
I was just reading the section of the C FAQ on pointers . It
I was reading the Simple Database section of Peter Siebel's book Practical Common Lisp
I'm reading this article and the section on the promise abstraction seems a little
I am reading ECMAScript Language Specification Function Calls section Can someone rephrase or detailed
Reading Java Concurrency In Practice, there's this part in section 3.5: public Holder holder;
Reading section 9.1 of OAuth Core 1.0, I only see a reference to performing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.