Search code examples
phpsymfonycontrollercode-organization

How to organize better the controllers in symfony framework?


I have a lot of controllers I want to know ways to organize them better


Solution

  • There shouldn't be very much common behavior between your controllers. If you do have duplicate code or common behavior, then it should probably be refactored out to a service. Thin controllers, fat models & services.

    Knp University has a really good (and free) screencast on the topic:

    http://knpuniversity.com/screencast/question-answer-day/model-organization