Clayton
Clayton

Reputation: 2007

Aligning/indenting function parameters in Netbeans

In Netbeans PHP, I want the next parameter to line up with the start of the first one on the previous line, but auto-indenting only gives me the following format:

my_function( $a,
        $b,
        ... );

What I want is:

my_function( $a,
             $b,
             ... );

Can Netbeans be set to do this? All I have seen so far is the ability to set a fixed number of spaces to be indented on parameter continuation.

Upvotes: 1

Views: 1503

Answers (2)

AleksMil
AleksMil

Reputation: 1

In NetBeans 8.2 it is available at Options > Editor > Formatting: Language: php - Category: wrapping - Method Parameters: Always - (Method call Arguments: always)

Upvotes: 0

MikeFHay
MikeFHay

Reputation: 9041

I don't write PHP in Netbeans, but for Java you can do Options > Editor > Formatting > Java > Alignment > check Method Parameters to get the effect you want when you do a Source > Format. I imagine you can do something similar for the PHP editor.

Upvotes: 2

Related Questions