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 7415569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:19:43+00:00 2026-05-29T07:19:43+00:00

How can I change the directory for the default module. I am using Zend

  • 0

How can I change the directory for the default module. I am using Zend Framework modular directory structure:

modules
    default
        controllers
            IndexController.php
        etc
    other-module

But how can I change the directory for the default module? I would like it to be called Api. So I would have:

modules
    Api
        controllers
            IndexController.php
    other-module

I want the URIs to stay the same so:

http://localhost

Will route to modules/Api/controllers/IndexController.php and run the indexAction.

This is what I have in the bootstrap

protected function _initFrontController()
{
    $front = Zend_Controller_Front::getInstance();
    $front->addModuleDirectory(APPLICATION_PATH.'/modules');
    return $front;
}
  • 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-29T07:19:44+00:00Added an answer on May 29, 2026 at 7:19 am

    In application/config.ini:

    # where to find modules
    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
    
    # set the default module
    resources.frontController.defaultModule = "api"
    
    # which modules to activate
    resources.modules.api   = "api"
    resources.moduler.other = "other"
    

    Then you can remove the _initFrontController() method from your Bootstrap.

    Note the character case here. Typically module names (as referenced in the config file and in routes) are lower-case. Also, the file name of the module will be lower-case (Ex: application/modules/api). Module-specific class names (say, a controller within an admin module) will capitalize the first char of the module name as the class prefix (Ex: class Admin_ArticleController extends Zend_Controller_Action).

    [For hyphenated and camelCase module names – like your ‘other-module’ example – I forget precisely how module-specific classes should be prefixed, but it’s easy enough to chase down if you really need it.]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I change the current working directory from within a Java program? Everything
How can I rename a virtual directory (i.e., change the Virtual Path name) in
I have created a package using PackageMaker and want to change the default icon
I am using Zend Framework 1.9.6. I want to start using cron jobs. I
I would like to know how to change default Azure SDK local deploy directory?
I do regularly change the data directory from the default /var/lib/mysql to something else
How is it possible to change to a user default directory Is there a
I am trying to change the data directory of a MySQL table using the
how can i change password manual directly in table membership? passwordformat=1, so how can
You can change the connection string at run-time like this. You make the connection

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.