Grocery CRUD automatically adds parameters from the library. You cannot (still in version 1.1.8) add additional parameters in a callback.
Update: In the latest version of Grocery CRUD you can now pass as many parameters as you need. This is the functionality offered by PHP from PHP version 5.4 or later. More specifically, with the use keyword. If you have a callback_after_insert : usually you will use it like this:
$crud->callback_after_insert(function ($post_array,$primary_key) {
From PHP 5.4 and later, you can add additional parameters with use so that, for example, you can:
$my_variable = 'test'; $another_variable = 'hello'; $crud->callback_after_insert(function ($post_array,$primary_key) use ($my_variable, $another_variable) {
source share