For a while I try to use heredoc, but soon gave up. Nowaday I do a lot of
<?=$var?> and <? foreach():?>...<? endforeach; ?>. Makes fixing HTML layout
issues a little easier than doing echos.
My HTML forms tend to look like this:
<input name="hello" value="<? echo htmlspecialchars($hello); ?>">
<? $checked = araay($which => "checked"); ?>
<input name="which" type="radio" value="a" <?=$checked['a']?>>
<input name="which" type="radio" value="b" <?=$checked['b']?>>
<input name="which" type="radio" value="c" <?=$checked['c']?>>
<? $selected = array($cow => "selected"); ?>
<select name="cow">
<option value="3" <?$selected[3]?>>Mad</option>
<option value="4" <?$selected[4]?>>Dead</option>
<option value="5" <?$selected[5]?>>Tastes like chicken</option>
</select>
Uzytkownik "Craig Thomson" <cr***@spam.free> napisal w wiadomosci
news:76********************************@4ax.com...
Do people generally try and output nicely formatted html from their
scripts?
I have been trying to, with variable indenting for tables etc. It
makes it easier to see the html and perhaps debug it, but it can make
ugly looking scripts.
What's the general consensus?
Craig