轉自:http://www.lvtao.net/tool/editplus-phpcb.html
phpCB下載:http://download.csdn.net/detail/frt007/9533158
利用editplus+phpCB 打造簡單的PHP代碼格式化工具
phpCB下載:http://download.csdn.net/detail/frt007/9533158
我們每一位開發人員都希望自己能寫出漂亮整潔的代碼,但是由於在開發過程中將過多的心思都放在了開發上了,忽略了代碼的整潔性,怎麼辦呢?我這裏向大家介紹一個:PHP Code Beautifier結合Editplus打造完美代碼工具。
軟件:
PHP Code Beautifie(官方網站:http://www.waterproof.fr/)
Editplus(官方網站:http://www.editplus.com/)
步驟如下:
先把PHP Code Beautifie 下載下來放到Editplus安裝根目錄下。
然後設置參數,在Editplus下點擊:工具=>參數設置=>用戶工具=>添加工具=>應用程序。
1)菜單文本:自己隨便寫一個名字,比如我這裏寫"格式化代碼"
2)命令瀏覽到我們剛放在根目錄的phpCB.exe
3)參數:--space-after-if --glue-arrow --optimize-eol --space-after-switch
--space-after-while --space-before-start-angle-bracket
--one-true-brace-function-declaration --one-true-brace
--extra-padding-for-case-statement --glue-amperscore
--change-shell-comment-to-double-slashes-comment --indent-with-tab
--force-large-php-code-tag --force-true-false-null-contant-lowercase
--comment-rendering-style PEAR --equal-align-position 50
--padding-char-count 1 "$(FilePath)"
4)初始目錄:$(FileDir)
5)動作:運行爲文本過濾器(替換)
參數設置如下圖:
執行:工具=》代碼格式化。
phpCB下載:http://download.csdn.net/detail/frt007/9533158