如何使用 DIV 结束循环


How to end a cycle with DIV ?

<div class="product-fields">
<?php
$custom_title = null;
foreach ($this->product->customfieldsSorted['normal'] as $field) { // I set the position to normal
if ( $field->is_hidden )
continue;
if ($field->display) {
?>
<?php if ($field->custom_title != $custom_title) { ?>
 <div class="product-field product-field-type-<?php echo $field->custom_title ?><?php //echo $field->field_type ?>">
<div class="product-fields-title"><?php echo JText::_($field->custom_title); ?></div>
<?php
if ($field->custom_tip)
 echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
}
?>
<span class="product-field-display"><?php echo $field->display ?></span>
<!--<span class="product-field-desc"><?php echo $field->custom_field_desc ?></span>-->
  <?php $custom_title = $field->custom_title; }
}
echo "<br /><br />&raquo;171717&raquo;</div>";
?>

我想在和周期有一个更近的 DIV

<span class="product-field-display"><?php echo $field->display ?></span>

但我不知道放在哪里

echo "<br /><br />&raquo;171717&raquo;</div>";

正确关闭div 标签:

<?php
$custom_title = null;
foreach ($this->product->customfieldsSorted['normal'] as $field) { // I set the position to normal
if ( $field->is_hidden )
continue;
if ($field->display) {
?>
<?php if ($field->custom_title != $custom_title) { ?>
 <div class="product-field product-field-type-<?php echo $field->custom_title; //echo $field->field_type ?>">
<div class="product-fields-title"><?php echo JText::_($field->custom_title); ?></div>
<?php
if ($field->custom_tip)
 echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
}
?>
<span class="product-field-display"><?php echo $field->display ?></span>
<!--<span class="product-field-desc"><?php echo $field->custom_field_desc ?></span>-->
  <?php $custom_title = $field->custom_title; }
?>
</div>
<?php
}
echo "<br /><br />&raquo;171717&raquo;";
?>
</div>