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

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.
主站蜘蛛池模板: 临清市| 邳州市| 志丹县| 泌阳县| 成武县| 梅河口市| 乌拉特后旗| 沙湾县| 威远县| 新郑市| 阿拉尔市| 衡南县| 九江市| 三河市| 乳源| 上饶县| 酉阳| 怀集县| 法库县| 平武县| 介休市| 固阳县| 密云县| 安陆市| 汽车| 正阳县| 平乐县| 永胜县| 辽源市| 新干县| 通城县| 浪卡子县| 白山市| 明星| 万全县| 密山市| 淮北市| 伊宁市| 怀仁县| 台湾省| 英吉沙县|