0

您好,我想就在 3 列中显示以下查询寻求帮助。我想我需要阅读数组,因为我似乎无法得到任何工作。我的这段代码是否可行,或者我需要在得到我想要的结果之前重写它吗?

<?php foreach ($this->items as $item) :?>
<?php if($item->state == 1 || ($item->state == 0 && JFactory::getUser()->authorise('core.edit.own',' com_bryllup'))):$show = true;?>
<input type="checkbox" name="<?php echo $item->felt_titel; ?>" value="<?php echo $item->felt_titel; ?>">
<h3><?php echo $item->felt_titel; ?></h3>
<p><?php echo $iyem->felt_beskrivelse; ?></p>
<?php endif; ?>

我想要实现的是这样的:

-Result1------Result2------Result3-
-Result4------Result5------Result6-
-etc-----------etc-----------etc---
4

1 回答 1

1

好吧,既然你已经添加了你喜欢的图表,那就更容易了。你可以用你现有的循环来做

CSS

// set width to a third of the width of the containing div
div.result {
    width:250px;
    height:300px;
    float:left;
}

HTML

<?php foreach ($this->items as $item) :?>
<?php if($item->state == 1 || ($item->state == 0 && JFactory::getUser()->authorise('core.edit.own',' com_bryllup'))):$show = true;?>
<input type="checkbox" name="<?php echo $item->felt_titel; ?>" value="<?php echo $item->felt_titel; ?>">

<div class="result">
    <h3><?php echo $item->felt_titel; ?></h3>
    <p><?php echo $iyem->felt_beskrivelse; ?></p>
</div>

<?php endif; ?>
于 2013-04-16T18:04:03.867 回答