ImageFill
in package
implements
FillInterface
FinalYes
Image background fill.
Tags
Table of Contents
Interfaces
- FillInterface
- Interface for all fill types.
Constants
- ALIGN_BOTTOM = 'bottom'
- ALIGN_CENTER = 'center'
- ALIGN_LEFT = 'left'
- Valid horizontal alignments.
- ALIGN_RIGHT = 'right'
- ALIGN_TOP = 'top'
- Valid vertical alignments.
- FILL_COVER = 'cover'
- Valid fill modes.
- FILL_FIT = 'fit'
Properties
- $fillMode : string|null
- The fill mode.
- $horizontalAlignment : string|null
- The horizontal alignment.
- $url : string
- $verticalAlignment : string|null
- The vertical alignment.
Methods
- __construct() : mixed
- Create a new ImageFill.
- asCover() : $this
- Set to cover mode.
- asFit() : $this
- Set to fit mode.
- fromBundle() : self
- Create an ImageFill from a bundle file.
- fromUrl() : self
- Create an ImageFill from a URL.
- getType() : string
- Get the fill type identifier.
- jsonSerialize() : array<string, mixed>
- {@inheritdoc}
- setFillMode() : $this
- Set the fill mode.
- setHorizontalAlignment() : $this
- Set the horizontal alignment.
- setVerticalAlignment() : $this
- Set the vertical alignment.
Constants
ALIGN_BOTTOM
public
mixed
ALIGN_BOTTOM
= 'bottom'
ALIGN_CENTER
public
mixed
ALIGN_CENTER
= 'center'
ALIGN_LEFT
Valid horizontal alignments.
public
mixed
ALIGN_LEFT
= 'left'
ALIGN_RIGHT
public
mixed
ALIGN_RIGHT
= 'right'
ALIGN_TOP
Valid vertical alignments.
public
mixed
ALIGN_TOP
= 'top'
FILL_COVER
Valid fill modes.
public
mixed
FILL_COVER
= 'cover'
FILL_FIT
public
mixed
FILL_FIT
= 'fit'
Properties
$fillMode
The fill mode.
private
string|null
$fillMode
= null
$horizontalAlignment
The horizontal alignment.
private
string|null
$horizontalAlignment
= null
$url read-only
private
string
$url
$verticalAlignment
The vertical alignment.
private
string|null
$verticalAlignment
= null
Methods
__construct()
Create a new ImageFill.
public
__construct(string $url) : mixed
Parameters
- $url : string
-
The image URL.
asCover()
Set to cover mode.
public
asCover() : $this
Return values
$thisasFit()
Set to fit mode.
public
asFit() : $this
Return values
$thisfromBundle()
Create an ImageFill from a bundle file.
public
static fromBundle(string $filename) : self
Parameters
- $filename : string
-
The filename in the bundle.
Return values
self —A new instance.
fromUrl()
Create an ImageFill from a URL.
public
static fromUrl(string $url) : self
Parameters
- $url : string
-
The image URL.
Return values
self —A new instance.
getType()
Get the fill type identifier.
public
getType() : string
Return values
string —The fill type.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setFillMode()
Set the fill mode.
public
setFillMode(string $mode) : $this
Parameters
- $mode : string
-
One of 'cover', 'fit'.
Return values
$thissetHorizontalAlignment()
Set the horizontal alignment.
public
setHorizontalAlignment(string $alignment) : $this
Parameters
- $alignment : string
-
One of 'left', 'center', 'right'.
Return values
$thissetVerticalAlignment()
Set the vertical alignment.
public
setVerticalAlignment(string $alignment) : $this
Parameters
- $alignment : string
-
One of 'top', 'center', 'bottom'.