如何将值作为点燃数据表中的链接?如何轻松实现?
控制器
function index()
{
$tmpl = array ( 'table_open' => '<table id="big_table" border="1" cellpadding="2" cellspacing="1" class="mytable">' );
$this->table->set_template($tmpl);
$this->table->set_heading('First Name','Last Name','Email');
$this->load->view('subscriber_view');
}
function datatable()
{
$this->datatables
->select("mro_id,mro_name,mctg_name,mctg_id")
->from('jil_mroproducts')
->join('jil_mrocategory', 'jil_mroproducts.mro_category=jil_mrocategory.mctg_id', 'INNER')
->unset_column('mro_id');
echo $this->datatables->generate();
}
答案 0 :(得分:3)
试试这个
$this->datatables->edit_column('mro_id', '<a href="controller/method/$1">$2</a>', 'mro_id, mro_name');
$1
指向mro_id
和
$2
指向mro_name
阅读此$this->datatables->edit_column($column, $content, $match_replacement);