Reputation: 9265
In netbeans how can one format it so that after if-blocks there is a blank line? I have been searching through the formatting options and trying different things to no avail.
e.g.
if ($lifegivesyoulemons) {
echo "say f' it and bail";
}
if ($if_they_take_my_stapler) {
echo "i will set the building on fire";
}
Upvotes: 1
Views: 480
Reputation: 5190
Not specifically for if-else
loop this should work for all methods also.
In your Netbeans IDE goto Tools - then select Editor tab.
Under Editor tab select Formatting select language PHP (as per your if-else
loop in question) and Category Blank Lines
And then scroll down in After Function field change value 0 to 1 like this
Click on Apply and Ok
Now select On Save tab. Select language PHP
Uncheck Use all language settings. After that from drop down select All Lines. Click on Ok
Now you type code hit Ctrl + S Netbeans automatically formats your code with one blank line after }
brace (bracket). (As of I know this should work both methods and loops also).
Upvotes: 1