How would you resize images when they were uploaded?
There is, for example, a function: $ Image-> resizeByWidth (width)
Where can it be implemented to resize images that are uploaded?
How can I add it to the following boot example:
class GalleryPage extends Page {
private static $many_many = array(
'GalleryImages' => 'Image'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab(
'Root.Upload',
$uploadField = new UploadField(
$name = 'GalleryImages',
$title = 'Upload one or more images (max 10 in total)'
)
);
$uploadField->setAllowedMaxFileNumber(10);
return $fields;
}
thanks
source
share