I am trying to get the callbacks working, but the examples in the documentation don't seem to work me, I am using Codeigniter 4 and the latest version of the CRUD framework BETA (v2.0.0-BETA)
when using callback_before_insert or callback_before_update ( as documented in the examples on https://www.grocerycrud.com/documentation/tutorial-using-callbacks/ ) I am getting errors that the method is unknown
Call to undefined method App\Libraries\GroceryCrud::callback_before_update()
$crud = new GroceryCrud(); $crud->setTable('fairs'); $crud->callback_before_insert(array($this,'set_slug_callback')); $crud->callback_before_update(array($this,'set_slug_callback')); $output = $crud->render(); function set_slug_callback($post_array, $primary_key) { if(empty($post_array['slug'])) { $post_array['slug'] = url_title($post_array['fairName'], '-', TRUE); } return $post_array; }