Aptana PHP Formatter - 使用自定义格式规则 [英] Aptana PHP Formatter - use custom formatting rules

查看:29
本文介绍了Aptana PHP Formatter - 使用自定义格式规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 PHP 文档中使用 Apatana 的格式设置功能,它运行良好,除了用于转换此内容的数组:

I'm using Apatana's formatting features in PHP documents, it works well except with arrays where it transform this:

$data = array(
    'email' => $params['email'],
    'username' => $params['username'],
);

进入这个:

$data = array('email' => $params['email'], 'username' => $params['username']);

有没有办法避免这种情况并设置自定义格式规则?

is there a way to avoid this and set custom formatting rules?

推荐答案

是的.有办法.

转到 Studio 的首选项并找到格式化程序"项.如果您使用的是默认格式化程序配置文件,请点击+"图标创建一个新的配置文件.

Go to the Studio's preferences and locate the 'Formatter' item. If you are using the default formatter profile, create a new one by clicking the '+' icon.

单击以编辑 PHP 格式设置(双击PHP"项,或单击它然后单击编辑"按钮).

Click to edit the PHP formatting setting (double-click the 'PHP' item, or click it and than click the 'Edit' button).

在新行"选项卡下,选中在数组创建元素之间插入新行"选项.确定对话框.确保您刚刚创建的配置文件是在格式化程序首选项页面中选择的配置文件,并格式化您的代码.

Under the 'New Lines' tab, check the option to 'Insert new line between array-creation elements'. OK the dialogs. Make sure that the profile you just created is the selected one in the formatter preferences page, and format your code.

干杯

这篇关于Aptana PHP Formatter - 使用自定义格式规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆