PHP Code Beautifier结合editplus打造代码美化工具

工具:
PHP Code Beautifie (官方网站:[url]http://www.waterproof.fr/[/url])
editplus (官方网站:[url]http://www.editplus.com/[/url])

先 把PHP Code Beautifie 下载下来放到editplus 安装目录下.

再在editplus 下点 工具>参数>用户工具>增加工具>程序

菜单文本:自己随便写一个名字,比如我们叫"代码格式化"
命令浏览到我们刚才下载的phpcb.exe
参数那儿写上:
--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)"

起始目录:$(FileDir)
注意:下面一定要选上 文本过滤器模式运行 替换

设置如下图(英文):
[img]http://dl.iteye.com/upload/attachment/246011/792ce350-9263-35fb-803b-d294b5d12b9b.jpg[/img]

运行前代码:

<?php class Point_List extends AbstractList{ protected function _prepareLayout(){ if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) { $breadcrumbs->addCrumb('my_point', array( 'label' => $this->__($title), 'title' => $this->__($title) )); } } public function getMyPoints() { $points = 0; $customer = Mage::getSingleton('customer/session')->getCustomer(); $customer = $customer->load($customer->getId()); $points = $customer->getPoints() + 0; return $points; } }

执行菜单项上的"代码格式化"
[img]http://dl.iteye.com/upload/attachment/246013/1e0ebbea-5d47-3fa4-ac97-aeed14c52e69.jpg[/img]

进行之后 的代码如图:

<?php class Point_List extends AbstractList
{
protected function _prepareLayout()
{
if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs'))
{
$breadcrumbs->addCrumb('my_point', array('label' => $this->__($title), 'title' => $this->__($title)));
}
}
public function getMyPoints()
{
$points = 0;
$customer = Mage::getSingleton('customer/session')->getCustomer();
$customer = $customer->load($customer->getId());
$points = $customer->getPoints() + 0;
return $points;
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值