我正在尝试使用callback_column
函数更改列值。
$crud = new grocery_CRUD();
$crud -> set_table('booking');
//$crud->set_relation('room_id','rooms','name');
$crud->callback_column('room_id',array($this,'_visitor_details_popup'));
此代码运行良好(_visitor_details_popup
函数返回值room_id
)
$crud = new grocery_CRUD();
$crud -> set_table('booking');
$crud->set_relation('room_id','rooms','name');
$crud->callback_column('room_id',array($this,'_visitor_details_popup'));
此代码效果不佳(room_id
未更改)
public function _visitor_details_popup($value, $row)
{
$visitor_details=explode(',',$value);
return '<a href="#">Name'.$visitor_details[1].'<a>'.'<div class="popup_content">Address'.$visitor_details[2].'Email'.$visitor_details[3].'</div>;
}
这是杂货杂货中的错误吗?有什么棘手的办法解决吗??