0
我有一個模型從mysql數據庫中獲取數據。我正在使用表格和分頁庫來顯示數據。在顯示數據時,會出現一個名爲「DELETE」的列,用於刪除每一行。而不是使用文本「刪除」我想使用圖像。我已經嘗試了很多將它添加到模型中,但它不起作用。你能請你幫忙嗎?代碼中的圖像Igniter anchor()函數
感謝提前:)
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;
}
非常感謝。我的問題不是很清楚,但你仍然設法回答正確。再次感謝。 :) –