Level51\Cloudinary\UploadField
Upload field for cloudinary using their javascript widget.
Synopsis
class UploadField
extends FormField
implements
FileHandleField
{
- // members
- private string $folder = '';
- private string $cropping = 'server';
- private $cropping_aspect_ratio = NULL;
- private static boolean $use_signed = true;
- protected string $fieldHolderTemplate = 'UploadField_holder';
- protected array $extraClasses = ;
- public array $allowedExtensions = ;
- // methods
- public string Field()
- public UploadField|FormField performReadonlyTransformation()
- public boolean showRemove()
- public string|array getPayload()
- private array getFrontendI18NPayload()
- public DataObject|Image|null getFile()
- public string getFolder()
- public string getFolderName()
- public string getCloudName()
- public array|null getAllowedExtensions()
- public $this setFolder()
- public $this setFolderName()
- public $this disableCropping()
- public $this setRatio()
- public UploadField|void setAllowedExtensions()
- public UploadField setAllowedFileCategories()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Implements
- SilverStripe\Forms\FileHandleField
Members
private
- $cropping
- $cropping_aspect_ratio
- $folder
- $use_signed
protected
- $extraClasses
- $fieldHolderTemplate
public
- $allowedExtensions
Methods
private
- getFrontendI18NPayload() — Prepare labels for the vue component.
public
- Field() — Get the actual upload field.
- disableCropping() — Disable the cropping interface before the actual upload.
- getAllowedExtensions() — Get allowed file extensions.
- getCloudName() — Get the Cloudinary "cloud name".
- getFile() — Get the cloudinary image record according to the value if set.
- getFolder() — Get the upload folder/path.
- getFolderName() — Get the upload folder/path.
- getPayload() — Get the frontend payload passed to the vue component.
- performReadonlyTransformation() — Return a clone with readonly flag set to true.
- setAllowedExtensions() — Set allowed file extensions.
- setAllowedFileCategories() — Set allowed file extensions by category.
- setFolder() — Change the folder to save into.
- setFolderName() — Change the folder to save into.
- setRatio() — Set a aspect ratio for the image cropping.
- showRemove() — Check if the remove button should be shown.