如何用DIV结束循环?

时间:2013-07-19 12:36:41

标签: php cycle

<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>";

1 个答案:

答案 0 :(得分:0)

正确关闭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>