I have tried several times but it seems that none of the callback functions work with my code.
Here is the method that I am calling grocery crud
public function show_courses()
{
$crud = new grocery_CRUD();
$crud->set_table('course');
$crud->set_theme('datatables');
$crud->fields('course_id','course_name','course_cordinator');
$crud->callback_after_insert(array($this, '_myfunc'));
$output = $crud->render();
$this->output($output);
}
and here is the callback function:
function _myfunc($post_array,$primary_key)
{
$q = array(
"notice" => $primary_key
);
$this->db->insert('notice', $q);
return true;
}
please help me to find what is wrong with my code.