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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:22:48+00:00 2026-06-04T18:22:48+00:00

I would like to start working with Zend Framework 2 and need some guidance

  • 0

I would like to start working with Zend Framework 2 and need some guidance as to the architecture of the framework. I compared Akrabat’s ZF2 tutorial with it’s ZF1 equivalent and the main difference I noticed so far seems to be the use of modules. I like the idea with modules as being independent and re-usable pieces of code and am thinking it could help segmenting my application and make it more maintainable. For instance I could have the following URL => module mapping:

http://example.org/products => Products module
http://example.org/services => Services module
http://example.org/oauth => Oauth module
[...]

What I’m confused about, is that some of my modules will share the same underlying database resources (e.g. both Products and Services use the same table for comments) and therefore the same database models. Accordingly, I’m wondering:

Where should I put my database models when those are used by multiple modules?

  • 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-06-04T18:22:51+00:00Added an answer on June 4, 2026 at 6:22 pm

    See the following article: http://adam.lundrigan.ca/2011/09/module-dependencies-in-zf2/

    You can create a third module (example: Base, Main) that is a dependency for the Products and Services modules, or you can add the Models to one of your modules and use that module as a dependency for the other one.

    Module.php

    /**
     * Get dependencies
     *
     * @return array
     */
    public function getDependencies()
    {
        return array(
            'BaseModule' => array(
                'version' => '>=0.1.0',
                'required' => true
            ),
        );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like start with .NET Micro Framework as my hobby project. What hardware
I would like to start working on an idea I have for an iphone
Their is a project I would like to start working on but the problem
I'm working on a 10-year-old Java webapp, and I would like to introduce some
Possible Duplicate: CSVs without quotes not working with fgetcsv I would like to start
I was reading the zend framework tutorial by Rob Allen. I am working on
I would like to start making code patches to Rails. Are there any good
I would like to start a personal project that will give me a lot
I would like to start with x no. of fields (in my app I
I would like to start a community discussion. As per my question, when do

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.