ImageTransformerInterface ​
- Type
- Interface
- Namespace
- craft\base\imagetransforms
- Implemented by
- craft\imagetransforms\FallbackTransformer, craft\imagetransforms\ImageTransformer
- Since
- 4.0.0
TransformerInterface defines the common interface to be implemented by all image drivers.
Public Methods ​
Method | Description |
---|---|
getTransformUrl() | Returns the URL for an image transform. |
invalidateAssetTransforms() | Invalidates all transforms for an asset. |
getTransformUrl()
​
Returns the URL for an image transform.
Arguments ​
$asset
(craft\elements\Asset)$imageTransform
(craft\models\ImageTransform)$immediately
(boolean) – Whether the image should be transformed immediately
Returns ​
string – The URL for the transform
Throws ​
- yii\base\NotSupportedException
if the transformer can’t be used with the given asset. - craft\errors\ImageTransformException
if a problem occurs.
invalidateAssetTransforms()
​
Invalidates all transforms for an asset.
Arguments ​
$asset
(craft\elements\Asset)