How do I change Netbeans PHP elseif auto formatting

629 Views Asked by At

Using PHP plugin v1.47.1 for NetBeans IDE 7.3 RC2.

I like to comment my if's and elseifs as follows:

/*
 * If this is the case, then do that.
 */
if (*condition1*) {
    // do some stuff.
}

/*
 * Otherwise, if this is the case, do the other thing.
 */
elseif (*condition2*) {
    // do some other stuff
}

/*
 * Finally, if neither of these is the case, then do something
 * totally different.
 */
else {
    // do something totally different.
}

But when I hit -- to autoformat, I get the following:

/*
 * If this is the case, then do that.
 */
if (*condition1*) {
    // do some stuff.
}
/*
 * Otherwise, if this is the case, do the other thing.
 */ elseif (*condition2*) {
    // do some other stuff
}
/*
 * Finally, if neither of these is the case, then do something
 * totally different.
 */ else {
    // do something totally different.
}

I can deal with it, but I'd like to be able to change it. I looked in Tools -> Options -> Editor -> Formatting but didn't see anything about putting an "elseif" or "else" on a new line.

1

There are 1 best solutions below

1
On

You can change a very limited number of settings related to formatting.

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