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

  • Home
  • SEARCH
  • 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 7675273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:55:28+00:00 2026-05-31T16:55:28+00:00

I am working on implementing Zend Framework within an existing project that has 2

  • 0

I am working on implementing Zend Framework within an existing project that has 2 front-ends sites (the company has two sites for two tv chanels) that are administrated by the same backend site. Currently these are poorly organized with two instances of zend framework that duplicate the code of the backend/admin area and duplicate the databases since both site and backend share the data base.

In implementing the Zend Framework, I would like to create be able to split this structure this way: 1 module front-site1, 1 module for front-end site 2 and 1 module for backend/admin site. I need to be able to point each module to the same models since all three modules work on the same database and on the same business objects.

However, I haven’t been able to find any information on how to do this in the documentation. Can anyone help with either a link on how to do this or some simple instructions on how to accomplish it? or to come up with a better structure if i am getting this wrong? What kind of configuration should i setup in ZF to make sure that http://www.site1.com -> module1 (front-end1) and http://www.site2.com -> module2 (front-end2) and both admin.site1 and admin.site2.com point to module3 (admin/backend)

  • 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-31T16:55:29+00:00Added an answer on May 31, 2026 at 4:55 pm

    Correct me if i’m wrong, you need to have all “core” and “library” for all models, and 3 different “modules”
    1) site1

    2) site2

    3) admin

    If that is correct, you can do the following things.

    File Index.PHP Add something like this.

    // Define application environment
    $environments = array(
        'localhost' => 'local'
        'www.site1.com' => 'site1',
        'www.site2.com' => 'site2',
    );
    
    $host = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null;
    
    if (isset($environments[$host])) {
        defined('APPLICATION_ENV')
            || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : $environments[$host]));
    }else{
        defined('APPLICATION_ENV','local');
    }
    

    Add all Environments you need and all your sites

    File config/application.ini Need to have something like this, with all the rest of the information.

    ; -----------------------------------------------------------------------
    [production]
    ; -----------------------------------------------------------------------
    resources.frontController.moduleDirectory[] = PUBLIC_PATH "/modules"
    resources.frontController.plugins.moduleselector = "Your_Application_Plugin_ModuleSelector"
    ; -----------------------------------------------------------------------
    [site1 : production]
    ; -----------------------------------------------------------------------
    settings.module.name = "site1"
    ; -----------------------------------------------------------------------
    [site2 : production]
    ; -----------------------------------------------------------------------
    settings.module.name = "site2"
    

    And create the plugin file.

    class Your_Application_Plugin_ModuleSelector extends Zend_Controller_Plugin_Abstract {
        public function preDispatch(Zend_Controller_Request_Abstract $request) {
            ...
            $request->setModuleName($getVarFromApp);
        }
    ...
    }
    

    You need to get the module name from the application.ini

    then you need to have the folder:

    /module/site1

    /module/site2

    /module/admin

    The admin site can access from both site, from the url http://www.site1.com/admin

    Example of controller from ADMIN

    <?php
    class Admin_IndexController extends Zend_Controller_Action
    {
    
        private $params;
    
        function init()
        {
    
        }
    
        public function indexAction()
        {
    
        }
    }
    

    Example of controller from site1 or site2

    <?php
    class IndexController extends Zend_Controller_Action
    {
    
        private $params;
    
        function init()
        {
    
        }
    
        public function indexAction()
        {
    
        }
    
    }
    

    I hope this works, do not check, but basically is the idea of what to do. Any question let me know

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

Sidebar

Related Questions

I am working on implementing Zend Framework within an existing project that has a
I am working on a huge php application with Zend framework, in that project
I'm working on implementing omniauth into a Rails project. My problem is that the
I am working on implementing a custom membership provider that works against an existing
I'm working on implementing a way to allow HTML in a field that I
I'm currently working on implementing a fulltext search engine for one of our sites,
I am implementing many SSB working on two different instances. They are data push
I'm working on implementing javascript functionality in my rails 3 app. Now that rjs
I'm currently working on implementing the Distributed Annotation System-standard for our project openSNP.org, however,
I'm working on implementing a reflection mechanism in C++. All objects within my code

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.