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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:19:35+00:00 2026-06-18T00:19:35+00:00

I am learning Symfony2, and part of the documentation on controllers states that the

  • 0

I am learning Symfony2, and part of the documentation on controllers states that the methods on the controller object are actually the controllers, whereas the object is more of a controller container.

Which part specifically is referred to as the controller(s)? I’m new to MVC and OOP, so I’m just trying to make sure I have it right.

  • 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-18T00:19:36+00:00Added an answer on June 18, 2026 at 12:19 am

    the page describes actually a convention endorsed by Symfony2 creators.

    in some MVC frameworks (esp. in Java) controllers are implemented by one-class-per-controller convention, e.g.:

    class ListContactsController {
        public function start() {
          // query db...
          return ...;
        }
    }
    
    class AddContactController {
        public function start($name, $details) {
          // insert into db...
          return ...;
        }
    }
    

    note that every controller-class has one method start() that defines what the controller actually does

    in other MVC frameworks (like Symfony2 or cake-php) controllers are implemented by one-method-per-controller convention, grouped together for convenience, e.g.:

    class ContactsController {
        public function list() {
          // query db...
          return ...;
        }
    
        public function add($name, $details) {
          // insert into db...
          return ...;
        }
    }
    

    here the convention assumes every controller is implemented as a method rather than a separate class with a particular method like start()

    EDIT: another way of thinking about this difference is this:

    • one-class-per-controller assumes there is one controller instance (might hold internal state) and when user interacts with the view, view is communicating with that controller instance via callbacks i.e. methods in controller’s class.
    • one-method-per-controller assumes any state is contained within parameters that are passed to methods, and when user interacts with the view, view is communicating with separate controllers/actions. those controllers are seen as independent concepts.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning Symfony2 (and OOP) and want to create a service that's available throughout
I have started learning Symfony2 and currently I am dealing with a command that
Learning some VBA. So far, I've constructed this piece of code which should allow
Learning a lot in my few years of programming that the best projects are
I'm learning Symfony2 now and in every tutorial I read, there are protected variables,
i am currently in the process of learning Symfony2. and i love its cleaniness
I know that the architecture is different in symfony 2.0 but im learning 1.4
Learning how to utilize Bootstrap, I noticed that the thumbnails had strange markup for
I know that Symfony2 has been released, but is it production ready, or are
Learning android programming, I posted a question recently, which helped me move along with

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.