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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:16:05+00:00 2026-05-14T14:16:05+00:00

I have a practical doubt , I am using OO php , and i

  • 0

I have a practical doubt ,

I am using OO php , and i am new to it. I am using zend framework to be clear.

I am writing controllers(class) and actions(methods) with in it say PatientMapper.php which has all single mysql table related actions and Patient.php which has all setter and getter functions.

I get a doubt that when should i write a new controller.

  1. Should i write a controller for all the actions on a single mysql table .

  2. or a single controller for all actions related to a module.

  • 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-14T14:16:05+00:00Added an answer on May 14, 2026 at 2:16 pm

    As opposed to the previous answers, I would say that your controller should not be related to your DB.

    Controllers don’t handle business logic, your models do.

    Besides that, you can write a controller for each entities.

    User is an entity, which can be wrapped in a controller, even if it depends on several tables.
    If your controller is getting bigger and bigger, you can switch to module (Zend Framework terminology) and create an User module, which has an Account controller, etc…

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

Sidebar

Related Questions

I have this doubt from long time, When ever I write the class using
I have a best practice question. I'm developing a OO MVC framework in PHP,
I have some doubts regarding sitemap.xml generation and Django's sitemap framework particularly. Let's say
I'm novice in Grails and I have a doubt. Lets say I have my
This question is just for a sake of knowledge. I don't have any practical
I have a strong database background but very little practical experience with ms sql
I have similar problem to one discussed here , but with stronger practical usage.
I understand the principles but i have a hard time seeing where the practical
Assuming that best practices have been followed when designing a new database, how does
I have a File Uploader in my ASP.NET application Using C#, we can upload

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.