官术网_书友最值得收藏!

Coding guidelines

One thing that I have learned in the past is to always establish coding guidelines. Following some of the eXtreme programming principles—namely, pair programming—I have learned that having a set of guidelines helps team integration and code readability.

Symfony-specific guidelines

These are some Symfony-specific guidelines:

  • One module is not for one page. The only time where this might be ruled out is if there is a strong possibility of the module being extended.

    For instance, if you have general footer pages, these could be a part of the general module. Also, grouping functionality allows code to be refactored into a plugin during development.

  • Application-specific settings should always go in the app.yml file.
  • When using a mail plugin for sending out emails, abide by the MVC pattern.

    That means use the action and templates rather than storing content inside a variable.

  • Keep PHP to an absolute minimum within templates.
  • Database table names should be plural and PHP models names should be singular.
主站蜘蛛池模板: 什邡市| 孟连| 贵港市| 望都县| 十堰市| 铜鼓县| 马山县| 大冶市| 九台市| 东海县| 靖宇县| 铜鼓县| 邹城市| 新晃| 赤壁市| 云龙县| 郸城县| 太和县| 绥中县| 吴忠市| 黄梅县| 仁寿县| 大宁县| 新郑市| 吉木萨尔县| 广平县| 吉首市| 兴隆县| 天水市| 四子王旗| 昆山市| 中山市| 左贡县| 潼关县| 新绛县| 舞钢市| 江都市| 多伦县| 息烽县| 濮阳县| 民和|