Consider the following from CodeIgniter. If I am doing this wrong, then please tell me:
<html>
<head>
<title><?=$title ?></title>
</head>
<body>
<h1><?=$heading; ?></h1>
<?php foreach ($query->result() as $row):?>
<p>
<?=$row->LastName . ', ' . $row->FirstName . ' ' . $row->MiddleName?>
</br>
<?=$row->myField?>
<?php if ($row->myField == ''):?>
no data found
<?php endif;?>
some text
<?=$row->anotherField ?>
</br>
<?php if ($row->purchasedate !='') {echo 'Purchase Date ' . mdate('%m' . '/' . '%d' . '/' . '%Y', strtotime($row-> purchasedate));}?>
</p>
<p>
<label for="ProductNumber">Product</label>
<input type="text" name="Product_number" id="ProductNumber" value =
<?=$row->ProductNumber?>
/>
</br>
<?php if ($row->Purchased == '-1'): ?>
<h3>Bought</h3>
<?php endif;?></br>
<?php if ($row->Sold == '-1'): ?>
<h3>Sold</h3>
<?php endif;?></br>
</p>
<?php endforeach;?>
</body>
</html>
I know some of it will not make sense. I am experimenting and also changed some of the names of fields.
My question is: Is this too much intermixing of code into my view? It seems this occurs with most templating but that there is some vague line that just feels wrong when you cross it and you say, "That's too much logic in my view." I don't know that line. Is this example crossing it? A foreach, if thens, echo, strtotime, the ?php tags, etc.
Is it just crossing the "line" when I put db access logic and start emitting all my html tags from print or response.write statements all on one big page behind the scenes on the server?