Aptana PHP Formatter - use custom formatting rules

 ̄綄美尐妖づ 提交于 2019-12-09 09:47:55

问题


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'],
);

into this:

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

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


回答1:


Yes. There is a way.

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.

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.

Cheers



来源:https://stackoverflow.com/questions/8660933/aptana-php-formatter-use-custom-formatting-rules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!