开发者

Why in Netbeans html code don't have indentation in php script after formatting

开发者 https://www.devze.com 2023-02-06 05:17 出处:网络
When I\'m writing html code in php script, the html code is align to left and dont get indentation/tabs.

When I'm writing html code in php script, the html code is align to left and dont get indentation/tabs.

here's example:

    <? foreach($cats as $key => $cat) : ?>
<div class="navbtn">
    &l开发者_Go百科t;a href="cat/<?=$cat['id']?>"><?=$cat['name']?></a>
</div>
    <? endforeach; ?>

*I'm using Netbeans 6.8


If the code formatter would intend HTML, it would actually alter the output of the script. One might think that whitespace in HTML has no effect, but for some rare cases it has, e.g. inside pre or textarea tags. I guess the PHP code formatter in Netbeans is just not smart enough and thus better ignores HTML completely.

0

精彩评论

暂无评论...
验证码 换一张
取 消