CallBackAfterUpload not working at all. When I lauch this code, the upload is do on the server normally.
I think that the Callback is not lauched.
Hello, it’s very strange, this is my function in my CI controller
public function news()
{
$crud = $this->_getGroceryCrudEnterprise();
// Configurer Grocery CRUD
$crud->setTable('news');
$crud->setSubject('News');
$crud->displayAs('video', 'Vidéo');
$crud->setTexteditor(['texte']);
$crud->setTheme('bootstrap-v4');
$crud->fieldType('la_date', 'date');
$crud->requiredFields(['titre']);
$uploadValidations = [
'maxUploadSize' => '20M', // 20 Mega Bytes
'minUploadSize' => '1K', // 1 Kilo Byte
'allowedFileTypes' => ['gif', 'jpeg', 'jpg', 'png']
];
$crud->setFieldUpload('photo','assets/news/photos', base_url() . 'assets/news/photos/', $uploadValidations);
$crud->callbackAfterUpload(function ($result) {
var_dump($result);
die;
});
// Afficher la liste des enregistrements
$output = $crud->render();
return $this->_superadmin_output($output);
}