OSdave
OSdave

Reputation: 8585

netbeans: code templates new line

To respect Zend's coding standard I want to have my methods this way:

public function myMethod()
{
    //my code here
}

But when I type fnc + CTRL+SPACE the code template put it like this:

public function myMethod() {
    //my code here
}

I modified the fnc code template like this:

function ${functionName}($$${param})
{
    ${selection}${cursor}
}

but no change. I've also try:

function ${functionName}($$${param})

{
    ${selection}${cursor}
}

but then the opening brace at column 1, and not column 4 (as it should be to respect identation).
Does anybody know how to achieve this? thanks in advance.

Upvotes: 1

Views: 1058

Answers (1)

Grzegorz Gąsak
Grzegorz Gąsak

Reputation: 195

This is late answer, but maybe you don't find solution yet.

Your problem is related to auto format code after use template.

If you define template at the bottom you have dropdown: On Template Expansion - select "Do nothing" or in Options->Editor in dropdown Category select "Braces" and change editor options (then you can use "Reformat Text" in code templates).

Upvotes: 5

Related Questions