Symfony Best Practices

Best practices in software development are all about improving communication between developers through standardization and enhancing security, maintainability, portability and interoperability by increasing code quality.

  1. 17
    Supplementary documents should be written in English
  2. 11
    No Propel Criteria or Doctrine_Query instances, SQL queries and any ORM-specific calls should ever be found in the templates or actions
  3. 7
    Use routes instead of raw module/action couple in url_for(), link_to() and redirect() calls
  4. 6
    Always enable output escaping and CSRF protection
  5. 4
    Controller methods should be less than 30 lines, controller class should have less than 15 action methods
  6. 3
    Always apply consistent coding standards
  7. 3
    Catch and log exception messages, display human-readable error messages to the end user
  8. 3
    Symfony core files should never be modified to add or change the features they provide.
  9. 2
    Verify cache settings, especially that the cache is enabled in prod
  10. 2
    Manage the view within the view
  11. 1
    Only deploy production front controllers in production
  12. 1
    The templates must contain PHP alternative templating syntax, for readability and ease of use
  13. 0
    Always write "symfony" starting with a small cap