Hello. How to use callbackBeforeInsert with parameter ?
Example :
Public function($id1, $id2){
$crud->callbackBeforeInsert(function ($stateParameters) {
// i wanna use $id1 and $id2 here, but didn’t work
return $stateParameters;
});
}
post by heruprambadi on Mar 22, 2024
post by nasrul on Mar 22, 2024
hello @heruprambadi
did you try using use syntax
$crud->callbackBeforeInsert(function ($stateParameters) use ($id2,$id2) {
$callbackAfterInsertModel->updateCustomerName($stateParameters->insertId);
// id1 and id2 should available here
return $stateParameters;
});
regards
Nasrul
post by heruprambadi on Mar 22, 2024
that’s the answer ! Thanks @nasrul ![]()
New & Unread Topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Use callbackColumn() but keep inline edit functionality |
|
3 | 648 | Apr 12 |
| Setting quick search values via JavaScript not working properly for booleans |
|
0 | 563 | Nov 2025 |
| callbackColumn() has not effect in v3.2.6 Enterprise |
|
2 | 695 | Dec 2025 |
| displayAs() doesn’t support new line in headings |
|
4 | 871 | Jan 5 |
| PRINT date format not consistent |
|
6 | 354 | Sep 7 |