Reputation: 2346
Why netbeans is not formatting the code properly?
The html code is not aligned/formatted properly between div's. See code below, try and paste this in to netbeans and press Alt + Shift + F
<div id="header">
<strong class="logo"></strong>
<?php if ($showHeaderLogout): ?>
<div style="float:right; margin-right: 20px">
<div> Logged in as <span style="font-weight:bold"> ?????? </span> </div>
</div>
<?php endif; ?>
</div>
<div class="nav-block">
<?php if ($showNav): ?>
<ul id="nav">
<li><a <?php echo ($headerActive == "home") ? "class='active'" : ""; ?> href="/home">Home</a></li>
</ul>
<?php endif; ?>
</div>
Upvotes: 0
Views: 1757
Reputation: 382
Thats a "bug" of netbeans formatter that get lost mixing php environment for indentation using constructions like if: and endif; and html.
For those cases I indent the code myself.
Upvotes: 2