在查看时将它们全部列在第一列中。尽管我把它分开了它不会加到第二或第三列上。继续到第一列的底部。
输入图片描述
控制器代码$data['post_verbs'] = $this->verb_model->get_verbs($post->id);
模型代码
public function get_verbs($id)
{
$sql = "SELECT fiilcekimleri.*, fiiller.title AS fiil_title, fiiller.title_slug AS title_slug
FROM fiilcekimleri LEFT JOIN fiiller ON fiiller.id = fiilcekimleri.fiil_id
WHERE fiilcekimleri.fiil_id = ? AND fiilcekimleri.altZamanId = ? AND fiilcekimleri.durumTurId = ? ORDER BY fiilcekimleri.ozneTurId ASC";
$query = $this->db->query($sql, array(clean_number($id)));
return $query->result();
}
视图代码<tbody>
<?php foreach ($post_verbs as $verbs => $code):?>
<tr>
<?php if ($code->altZamanId == 2 AND $code->durumTurId == 1) { ?>
<td> <?php echo $code->title; ?> </td> <?php } ?>
<?php if ($code->altZamanId == 2 AND $code->durumTurId == 2) { ?>
<td> <?php echo $code->title; ?></td> <?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
控制器
$data['post_1'] = $this->fiil_model->get_verbs($post->id, 2, 1);
$data['post_2'] = $this->fiil_model->get_verbs($post->id, 2, 2);
$data['post_3'] = $this->fiil_model->get_verbs($post->id, 2, 3);
$data['post_4'] = $this->fiil_model->get_verbs($post->id, 2, 4);
模型public function get_verbs($id, $altZamanId, $durumTurId)
{
$sql = "SELECT fiilcekimleri.*, fiiller.title AS fiil_title, fiiller.title_slug AS title_slug
FROM fiilcekimleri LEFT JOIN fiiller ON fiiller.id = fiilcekimleri.fiil_id
WHERE fiilcekimleri.fiil_id = ? AND fiilcekimleri.altZamanId = ? AND fiilcekimleri.durumTurId = ? ORDER BY fiilcekimleri.ozneTurId ASC";
$query = $this->db->query($sql, array(clean_number($id), clean_number($altZamanId), clean_number($durumTurId)));
return $query->result();
}
视图
<tbody>
<?php foreach ($post_1 as $verbs => $code):?>
<tr>
<td><?php echo $code->title; ?></td>
<td><?php echo $post_2[$verbs]->title; ?></td>
<td><?php echo $post_3[$verbs]->title; ?></td>
<td><?php echo $post_4[$verbs]->title; ?></td>
</tr>
<?php endforeach; ?>
</tbody>