\Charcoal\Admin\UiImageAttributesTrait

Common Image Attributes for HTML

Summary

Methods
Properties
Constants
setStyleAttr()
styleAttr()
setClassAttr()
classAttr()
setWidth()
width()
setHeight()
height()
setMaxWidth()
maxWidth()
setMaxHeight()
maxHeight()
No public properties found
No constants found
defaultStyleAttr()
parseStyleAttr()
isDataUri()
$classAttr
$styleAttr
$width
$height
$maxWidth
$maxHeight
N/A
No private methods found
No private properties found
N/A

Properties

$classAttr

$classAttr : string|null

The CSS classes for the HTML `class` attribute.

Type

string|null

$styleAttr

$styleAttr : string|null

The CSS styling declarations for the HTML `style` attribute.

Type

string|null

$width

$width : string

The intrinsic width when displaying the image.

Type

string

$height

$height : string

The intrinsic height when displaying the image.

Type

string

$maxWidth

$maxWidth : string

The maximum width to display the image.

Type

string

$maxHeight

$maxHeight : string

The maximum height to display the image.

Type

string

Methods

setStyleAttr()

setStyleAttr(string|array<mixed,string>  $styles) : \Charcoal\Admin\Ui\ImageDisplay

Set the CSS styling declarations to apply on the image.

Parameters

string|array<mixed,string> $styles

An associative array of CSS styles.

Returns

\Charcoal\Admin\Ui\ImageDisplay —

Chainable

styleAttr()

styleAttr() : string

Retrieve the CSS styling declarations for the HTML `style` attribute.

Returns

string

setClassAttr()

setClassAttr(string|array<mixed,string>  $classes) : \Charcoal\Admin\Ui\ImageDisplay

Set the CSS classes to apply on the image.

Parameters

string|array<mixed,string> $classes

A space-separated list of CSS classes.

Returns

\Charcoal\Admin\Ui\ImageDisplay —

Chainable

classAttr()

classAttr() : string

Retrieve the CSS classes for the HTML `class` attribute.

Returns

string

setWidth()

setWidth(mixed  $width) : \Charcoal\Admin\Ui\ImageDisplay

Set the display width of the image.

If integer specified, 'px' will be append to it.

Parameters

mixed $width

A CSS value; a length, percentage or calc().

Returns

\Charcoal\Admin\Ui\ImageDisplay —

Chainable

width()

width() : string

Retrieve the display width of the image.

Returns

string

setHeight()

setHeight(mixed  $height) : \Charcoal\Admin\Ui\ImageDisplay

Set the display height of the image.

If integer specified, 'px' will be append to it.

Parameters

mixed $height

A CSS value; a length, percentage or calc().

Returns

\Charcoal\Admin\Ui\ImageDisplay —

Chainable

height()

height() : string

Retrieve the display width of the image.

Returns

string

setMaxWidth()

setMaxWidth(mixed  $width) : \Charcoal\Admin\Ui\ImageDisplay

Set the maximum width to display the image.

If integer specified, 'px' will be append to it.

Parameters

mixed $width

A CSS value; a length, percentage or calc().

Returns

\Charcoal\Admin\Ui\ImageDisplay —

Chainable

maxWidth()

maxWidth() : string

Retrieve the maximum width to display the image.

Returns

string

setMaxHeight()

setMaxHeight(mixed  $height) : \Charcoal\Admin\Ui\ImageDisplay

Set the maximum height to display the image.

If integer specified, 'px' will be append to it.

Parameters

mixed $height

A CSS value; a length, percentage or calc().

Returns

\Charcoal\Admin\Ui\ImageDisplay —

Chainable

maxHeight()

maxHeight() : string

Retrieve the maximum height to display the image.

Returns

string

defaultStyleAttr()

defaultStyleAttr() : string

Parse the CSS styling declarations from the property's display features.

Returns

string

parseStyleAttr()

parseStyleAttr(array<mixed,string>  $styles) : string

Parse the CSS styling declarations from the property's display features.

Parameters

array<mixed,string> $styles

An associative array of CSS styles.

Returns

string

isDataUri()

isDataUri(string  $val) : boolean

Determine if the value is a {@see @see http://en.wikipedia.org/wiki/Data_URI_scheme Data URI}.

Parameters

string $val

A path or URI to analyze.

Returns

boolean