class Border extends BaseAction

Adds a solid border around an image or video.

Learn more: Adding image borders

Methods

__construct(mixed ...$qualifiers)

Action constructor.

addQualifier(BaseComponent $qualifier = null)

Adds the qualifier to the action.

addQualifiers(array ...$qualifiers)

Adds qualifiers to the action.

setGenericAction(string $action)

Adds (sets) generic (raw) action.

setFlag(FlagQualifier $flag, bool $set = true)

Sets the flag.

unsetFlag(FlagQualifier $flag)

Removes the flag.

importAction(BaseAction|null $action)

Imports (merges) qualifiers and flags from another action.

jsonSerialize()

Serializes to json.

__toString()

Serializes to Cloudinary URL format

solid(int $width = null, string $color = null)

Adds a border around the image.

width(int $width)

Sets the width of the border.

style(string $style)

Sets the style of the border.

color(string $color)

Sets the color of the border.

roundCorners(int|string|CornerRadius $radiusOrTopLeft, int $topRight = null, int $bottomRight = null, int $bottomLeft = null)

Rounds the specified corners of an image.

Details

__construct(mixed ...$qualifiers)

Action constructor.

Parameters

Name Type Description
...$qualifiers mixed

$this addQualifier(BaseComponent $qualifier = null)

Adds the qualifier to the action.

Parameters

Name Type Description
$qualifier BaseComponent The qualifier to add.

Return Value

$this

$this addQualifiers(array ...$qualifiers)

Adds qualifiers to the action.

Parameters

Name Type Description
...$qualifiers array The qualifiers to add.

Return Value

$this

BaseAction setGenericAction(string $action)

Adds (sets) generic (raw) action.

Parameters

Name Type Description
$action string The generic action string.

Return Value

BaseAction

$this setFlag(FlagQualifier $flag, bool $set = true)

Sets the flag.

Parameters

Name Type Description
$flag FlagQualifier The flag to set.
$set bool Indicates whether to set(true) or unset(false) the flag instead. (Used for avoiding if conditions all over the code)

Return Value

$this

$this unsetFlag(FlagQualifier $flag)

Removes the flag.

Parameters

Name Type Description
$flag FlagQualifier The flag to unset.

Return Value

$this

$this importAction(BaseAction|null $action)

Imports (merges) qualifiers and flags from another action.

Parameters

Name Type Description
$action BaseAction|null The action to import.

Return Value

$this

mixed jsonSerialize()

Serializes to json.

Return Value

mixed

string __toString()

Serializes to Cloudinary URL format

Return Value

string

static Border solid(int $width = null, string $color = null)

Adds a border around the image.

Parameters

Name Type Description
$width int The width in pixels.
$color string The color of the border.

Return Value

Border

$this width(int $width)

Sets the width of the border.

Parameters

Name Type Description
$width int The width in pixels.

Return Value

$this

$this style(string $style)

Sets the style of the border.

Parameters

Name Type Description
$style string The style of the border. Currently only "solid" is supported.

Return Value

$this

$this color(string $color)

Sets the color of the border.

Parameters

Name Type Description
$color string The color of the border.

Return Value

$this

Border roundCorners(int|string|CornerRadius $radiusOrTopLeft, int $topRight = null, int $bottomRight = null, int $bottomLeft = null)

Rounds the specified corners of an image.

Only $radiusOrTopLeft specified: All four corners are rounded equally according to the value.
Only $radiusOrTopLeft and $topRight specified: Round the top-left & bottom-right corners according to $radiusOrTopLeft, round the top-right & bottom-left corners according to $topRight.
Only $radiusOrTopLeft, $topRight and $bottomRight specified: Round the top-left corner according to $radiusOrTopLeft, round the top-right & bottom-left corners according to $topRight, round the bottom-right corner according to $bottomRight.
All qualifiers specified: Each corner is rounded accordingly.

Parameters

Name Type Description
$radiusOrTopLeft int|string|CornerRadius The radius in pixels of the top left corner or all the corners if no other corners are specified.
$topRight int The radius in pixels of the top right corner.
$bottomRight int The radius in pixels of the bottom right corner.
$bottomLeft int The radius in pixels of the bottom left corner.

Return Value

Border

See also

RoundCorners

Constants

MAIN_QUALIFIER