In case you've missed it, you are looking at an older version of the website. Checkout our latest version, we promise you will love it 😍

callback_delete

void callback_delete(mixed $callback )
Quick Description: This callback escapes the auto delete of the CRUD , and runs only the callback.
This callback escapes the auto delete of the CRUD , and runs only the callback.
Below you can see an example:

 
public function user(){
    $crud = new grocery_CRUD();
 
    $crud->set_table('cms_user');
    $crud->set_subject('User List');
    $crud->required_fields('user_name');
 
    $crud->columns('user_name','email','real_name','active');
    $crud->change_field_type('active', 'true_false');
 
    $crud->callback_delete(array($this,'delete_user'));
 
    $output = $crud->render();
 
    $this->_example_output($output);
}
 
public function delete_user($primary_key)
{
    return $this->db->update('cms_user',array('deleted' => '1'),array('id' => $primary_key));
}