【发布时间】:2011-10-27 09:41:32
【问题描述】:
我有一个模型可以从 mysql 数据库中获取数据。我正在使用表格和分页库来显示数据。显示数据时有一个名为“DELETE”的列,用于删除每一行。我想使用图像而不是使用文本“DELETE”。我已经尝试了很多将它添加到模型中,但它不起作用。请您帮帮我好吗?
在此先感谢 :)
function batch_list()
{
$config['per_page'] = 15;
$this->db->select('batchname, class, batchinstructor');
$this->db->order_by("batchid", "desc");
$rows = $this->db->get('batch',$config['per_page'],$this->uri->segment(3))->result_array();
$sl = $this->uri->segment(3) + 1; // so that it begins from 1 not 0
foreach ($rows as $count => $row)
{
array_unshift($rows[$count], $sl.'.');
$sl = $sl + 1;
$rows[$count]['batchname'] = anchor('batch_list/get/'.$row['batchname'],$row['batchname']);
$rows[$count]['Edit'] = anchor('update_student/update/'.$row['batchname'],'Edit');
$rows[$count]['Delete'] = anchor('report/'.$row['batchname'],'<img src="base_url().support/images/icons /cross.png" alt="Delete" />"'); //<<< This is where I actually tried/want to add the image
}
return $rows;
}
【问题讨论】: