CropperField\CropperField
Synopsis
class CropperField
extends FormField
{
- // members
- private static array $cropper_options = ;
- private static array $dependencies = ;
- protected DataObject $record;
- protected CropperInterface $cropper;
- protected $options;
- // methods
- public void __construct()
- public void setForm()
- public $this setOptions()
- public array getOptions()
- public mixed getOption()
- public $this setOption()
- public void getAdapter()
- public void setAdapter()
- public CropperInterface getCropper()
- public void setCropper()
- public $this injectCropper()
- public void saveInto()
- public void setRecord()
- public DataObject getRecord()
- public Image getExistingThumbnail()
- public Image generateCropped()
- public array getCropData()
- public boolean canCrop()
- public boolean hasSourceFile()
- public void Field()
- protected void requireFrontend()
Hierarchy
Extends
- FormField
Members
private
- $cropper_options
- $dependencies
protected
- $cropper
—
\CropperField\Cropper\CropperInterface
The object that does the hard work. - $options
—
array
The options that will be used to initalize the plugin. - $record
—
DataObject
Determined by getRecord (like UploadField)
Methods
protected
- requireFrontend() — Pull in the cropper.js requirements. If in dev mode, bring in unminified.
public
- __construct()
- Field()
- canCrop() — If the tickbox on the frontend is unchecked, do not regenerate
- generateCropped()
- getAdapter()
- getCropData()
- getCropper()
- getExistingThumbnail()
- getOption()
- getOptions()
- getRecord() — Get the record to use as "Parent" for uploaded Files (eg a Page with a has_one to File) If none is set, it will use Form->getRecord() or Form->Controller()->data()
- hasSourceFile() — If the file does not exist, then do not (re)generate (otherwise doing so would cause errors)
- injectCropper() — Use Injector to locate a CropperInterface implementor.
- saveInto() — If enabled, crop the image, save as a new file, and link it via relation
- setAdapter()
- setCropper()
- setForm()
- setOption() — Set an option after initialisation
- setOptions()
- setRecord() — Force a record to be used as "Parent" for uploaded Files (eg a Page with a has_one to File)