ArtiGrid
Upload Files
The image field type now supports Jcrop-style image cropping (powered by Cropper.js internally, with no jQuery dependency), built directly into the file upload flow.
You can use it with a single image, or enable 'multiple' => true to allow uploading several images at once, each with its own crop and preview before saving.
You can also define the crop's aspect ratio (aspectRatio) and the output size (width, height) to match whatever your form needs.
<?php
$grid = new ArtiGrid();
$grid->table('payments')
->template('bootstrap5')
->required(false)
->imageField('receipt_images', [
'multiple' => true,
'aspectRatio' => 1,
'width' => 400,
'height' => 400,
])
->validation_required('customerNumber')
->validation_required('checkNumber')
->validation_required('receipt_images')
->formFields(['customerNumber','checkNumber', 'paymentDate', 'amount', 'receipt_images']);
echo $grid->render('insert');
?>