php 编辑 NetBeans 源格式标准
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2712285/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
editing the NetBeans source formatting standard
提问by Victor Stanciu
Is there any way of changing the standard by which NetBeans automatically formats the code when doing "Source->Format"? I seem to remember seeing this option somewhere, but I can't find anything about it.
有什么方法可以更改 NetBeans 在执行“Source->Format”时自动格式化代码的标准?我似乎记得在某处看到过这个选项,但我找不到任何关于它的信息。
回答by Gaurav Sharma
You can change a very limited number of settings related to formatting.
open up netbeans IDE
Go to tools->options
click on Editorbutton on top left of the options dialog box
click on the formatting tab
select PHP from the language select box
then you would be able to see the required settings that can be changed.
您可以更改非常有限的与格式相关的设置。
打开 netbeans IDE
转到工具->选项
单击选项对话框左上角的编辑器按钮
单击格式选项卡
从语言选择框中选择 PHP
然后您将能够看到可以更改的所需设置。
Latest version 7.3 will solve most of your needs.
最新版本 7.3 将解决您的大部分需求。
回答by vkraemer
The formatting preferences are at two 'levels' in NetBeans 6.9 Betaand NetBeans 6.8. There is a global setting, which is available via the Options item of the Tools menu (Preferences item of the NetBeans menu on Mac OS X). This opens a Options dialog. Select the Formatting tab of the Editor 'category', and then change the language to PHP.
NetBeans 6.9 Beta和 NetBeans 6.8 中的格式首选项处于两个“级别” 。有一个全局设置,可通过“工具”菜单的“选项”项(Mac OS X 上 NetBeans 菜单的“首选项”项)获得。这将打开一个选项对话框。选择编辑器“类别”的格式选项卡,然后将语言更改为 PHP。
alt text http://www.freeimagehosting.net/uploads/587cd38396.png
替代文字 http://www.freeimagehosting.net/uploads/587cd38396.png
You can also specify formatting on a per-project basis. To do that, select your PHP project in the Project explorer and the select the Project Properties item from the File menu. When the Properties dialog opens, select the Formatting category from the navigation list on the left side of the dialog.
您还可以在每个项目的基础上指定格式。为此,请在项目资源管理器中选择您的 PHP 项目,然后从文件菜单中选择项目属性项。当“属性”对话框打开时,从对话框左侧的导航列表中选择“格式”类别。
alt text http://www.freeimagehosting.net/uploads/47904df6e4.png
替代文字 http://www.freeimagehosting.net/uploads/47904df6e4.png
Note: In 6.8, there are only two formatting categories that you can change: Tabs and Indents; Braces. It looks like the "preview" area is not rendered correctly. NetBeans 6.9 Beta extends the number of formatting categories (Tabs and Indents, Alignment, Braces, Blank Lines, Spaces, Wrapping). The issues with the preview area appear to be resolved, too.
注意:在 6.8 中,只有两种格式类别可以更改:制表符和缩进;大括号。看起来“预览”区域没有正确呈现。NetBeans 6.9 Beta 扩展了格式类别的数量(制表符和缩进、对齐、大括号、空行、空格、换行)。预览区域的问题似乎也已解决。
回答by Chetan Sharma
This might help.
这可能会有所帮助。
Tools->Options->Editor->Formatting
工具->选项->编辑器->格式

