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

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.
主站蜘蛛池模板: 舒兰市| 溧阳市| 青海省| 德惠市| 平安县| 靖西县| 徐州市| 古交市| 乳源| 汶川县| 江阴市| 黔江区| 呼和浩特市| 曲周县| 波密县| 文安县| 威信县| 明溪县| 舒兰市| 饶阳县| 庄浪县| 肃宁县| 蒲江县| 平山县| 临澧县| 久治县| 嵊泗县| 玉屏| 清河县| 都昌县| 岳阳市| 通渭县| 福海县| 胶南市| 宁阳县| 宁津县| 江达县| 瑞丽市| 泸水县| 昭平县| 遂川县|