public_function upload_image()
{
$crud = $this->_getGroceryCrudEnterprise();
$crud->setFieldUpload('photo1', 'assets/images/accueil/photo1', 'assets/images/accueil/photo1');
.....
$crud->callbackAfterUpload(function ($data = null) {
$nom=$data->filename;
$path=$data->filePath;
$fullPath = $path.$nom;
$image=new \Gumlet\ImageResize($fullPath);
$image->resizeToBestFit(500, 300);
$image->save($fullPath);
return $data;
});
....
}
In something like this
public_function upload_image()
{
...
$crud->callbackAfterUpload(resize($data = null);
....
}
public function resize ($data)
{
$nom=$data->filename;
$path=$data->filePath;
$fullPath = $path.$nom;
$image=new \Gumlet\ImageResize($fullPath);
$image->resizeToBestFit(500, 300);
$image->save($fullPath);
return $data;
});