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

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.
主站蜘蛛池模板: 融水| 蒲江县| 隆德县| 晋宁县| 涞源县| 察隅县| 嫩江县| 英山县| 福泉市| 康保县| 哈尔滨市| 象州县| 巩留县| 介休市| 辽中县| 阜新市| 玉环县| 德清县| 翁牛特旗| 开原市| 新闻| 乌鲁木齐县| 五华县| 宣恩县| 昆山市| 武乡县| 乌兰县| 神木县| 康乐县| 三亚市| 乌鲁木齐县| 永宁县| 太康县| 泸水县| 高邮市| 琼中| 鹤峰县| 女性| 宝丰县| 辽中县| 信丰县|