views:

360

answers:

3

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.

A: 

This might help.

Tools->Options->Editor->Formatting

Chetan sharma
+2  A: 

You can change a very limited number of settings related to formatting.
open up netbeans IDE
Go to tools->options
click on Editor button 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.



The upcoming version 6.9 will solve your current issue of changing the source formatting standard. Look here and here for more

Gaurav Sharma
+1  A: 

The formatting preferences are at two 'levels' in NetBeans 6.9 Beta and 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.

alt text

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.

alt text

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.

vkraemer