数组声明中的Netbeans PHP空间 [英] Netbeans PHP spaces in array declaration

查看:159
本文介绍了数组声明中的Netbeans PHP空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的问题,我有数组:

  array(
'aaa'=> 1,
'bbbbbbbb'=> 2,
'ccccc'=> 3,
'dd'=> 4
);

我想要格式代码:

<$ (
'aaa'=> 1,
'bbbbbbbb'=> 2,
'ccccc'=> 3,
'dd'=> 4
);

是否有格式选项可以执行此操作,因为我没有看到类似的内容? p>

PS。对不起,我的英文。


解决方案

将PHP代码导入到NetBeans 7.1中在对齐类别中有用于组多行对齐 - 赋值和数组的新属性初始化工具。





在左边的网站 - Assignment属性是关闭,并在正确的网站上的财产。正如你所看到的,当这个属性被设置时,赋值char'='被放置在一个组中最长的标识符之后。该组被定义为包含相同类型的分配的多个行。一个组的末尾可以是空行,行只有一个注释,不同的表达式,一个块的结束。这个格式化选项适用于变量赋值,字段初始化和常量。

第二个新属性是数组初始化程序。



这两个属性默认都是关闭的。只要打开它,就完成了。

Simple question, I have array:

array(
  'aaa' => 1,
  'bbbbbbbb' => 2,
  'ccccc' => 3,
  'dd' => 4
);

and I want format code to:

array(
  'aaa'       => 1,
  'bbbbbbbb'  => 2,
  'ccccc'     => 3,
  'dd'        => 4
);

Is there a Formatting option to do this, because I don't see anything like this?

PS. Sorry for my English.

解决方案

PHP code into NetBeans 7.1 In Alignment category there are new properties for Group Multiline Alignment - Assignment and Array Initializer.

On the left site - Assignment property is off and on the right site the property is on. As you can see, when the property is set on, then the assignment char '=' is placed after the longest identifier in a group. The group is defined as a number of lines that contains the same type of assignments. End of a group can be empty line, line where is only a comment, different expression, end of a block. This formatting options works for variable assignment, field initialization and constants.

The second new property is for Array Initializer.

Both properties are switched off by default. Just turn it on and you are done.

这篇关于数组声明中的Netbeans PHP空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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