web coding principle
TRANSCRIPT
FRAMEWORK
CodeIgniterMVC
• Controller: HTTP request, 參數檢查, Model & View邏輯
• Model: 資料新增, 刪除,修改
• View: 顯示頁面
• css class instead of style
DATABSE
欄位和資料表要寫註解PDOnotORM !?
Other ORM• http://datamapper.wanwizard.eu• http://www.doctrine-project.org
NAMING
命名需要有意義
PSRhttp://www.php-fig.org/psr/psr-2
CI• http://www.codeigniter.org.tw/user_guide/general/styleguide.
html4 space instead of tab
CSS
RWD• font-size: em• width, height: grid system
\themes• \default
• \css• main.css
• \img
https://github.com/doggy8088/CSS-Guidelines/blob/master/README.md
TESTING SOP
White-Box Testing• Data flow• Control flow
Black-Box Testing• Staging test
• 合併到 develop 會自動更新到 stagingUnit Testing
TDD
GIT FLOW
http://nvie.com/posts/a-successful-git-branching-model/
COMMIT SOP
1. 在本地端測試自己新的功能是”正確”完成的
2. Git Pull 取得最新的狀態
3. Commit Code 請一隻一隻程式確定
• 禁用 commit –a4. 一隻一隻程式去確定這次改變的 Diff5. 寫 log6. Merger new branch to Develop7. 到 Staging 去驗證本次寫的功能
MULTI LANGUAGE
語言
• 繁體
• 简体
• English\application\language\$language\message_lang.php
• \application\config\config.php
STRING TABLE
• 請一開始就使用 String table 寫法
• 英文、阿拉伯數字和中文中間空一格(半形)• 標點符號請用全形
• PDF、MP3 統一使用大寫
• 多國語言請僅量不要使用 string 組合
• 有變數的提示訊息使用格式化的 string 處理
• sprintf : http://www.php.net/manual/en/function.sprintf.php