Properties

$baseUrl

$baseUrl : \Psr\Http\Message\UriInterface|string

The base URI for the Charcoal application.

Type

\Psr\Http\Message\UriInterface|string

$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

$type

$type : string

Type

string

$displayType

$displayType : string

Type

string

$displayId

$displayId : string

Type

string

$displayClass

$displayClass : string

Type

string

$displayOptions

$displayOptions : mixed

Type

mixed

$lang

$lang : string

Type

string

$ident

$ident : string

Type

string

$multiple

$multiple : boolean

Type

boolean

$propertyData

$propertyData : array

Type

array

$propertyVal

$propertyVal : mixed

Type

mixed

$property

$property : \Charcoal\Property\PropertyInterface

Type

\Charcoal\Property\PropertyInterface

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

__construct()

__construct(array|\Charcoal\Admin\Property\ArrayAccess  $data = null) 

Parameters

array|\Charcoal\Admin\Property\ArrayAccess $data

Optional. Dependencies.

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Inject dependencies from a DI Container.

Parameters

\Pimple\Container $container

A dependencies container instance.

setData()

setData(array  $data) : \Charcoal\Admin\Property\Display

This function takes an array and fill the model object with its value.

This method either calls a setter for each key (set_{$key}()) or sets a public member.

For example, calling with setData(['properties'=>$properties]) would call setProperties($properties), becasue setProperties() exists.

But calling with setData(['foobar'=>$foo]) would set the $foobar member on the metadata object, because the method set_foobar() does not exist.

Parameters

array $data

The display data.

Returns

\Charcoal\Admin\Property\Display —

Chainable

propertyVal()

propertyVal() : mixed

Returns

mixed

lang()

lang() : string

Get the input language

Returns

string

setIdent()

setIdent(string  $ident) : \Charcoal\Admin\Property\Widget

Parameters

string $ident

Display identifier.

Throws

\InvalidArgumentException

If the ident is not a string.

Returns

\Charcoal\Admin\Property\Widget —

Chainable

ident()

ident() : string

Returns

string

setMultiple()

setMultiple(boolean  $multiple) : \Charcoal\Admin\Property\Widget

Parameters

boolean $multiple

Multiple flag.

Returns

\Charcoal\Admin\Property\Widget —

(Chainable)

multiple()

multiple() : boolean

Returns

boolean

setDisplayId()

setDisplayId(string  $displayId) : \Charcoal\Admin\Property\Display

Parameters

string $displayId

HTML id attribute.

Returns

\Charcoal\Admin\Property\Display —

Chainable

displayId()

displayId() : string

Get the display ID.

If none was previously set, than a unique random one will be generated.

Returns

string

setDisplayClass()

setDisplayClass(string  $displayClass) : \Charcoal\Admin\Property\AbstractPropertyDisplay

Parameters

string $displayClass

The display class attribute.

Throws

\InvalidArgumentException

If the class is not a string.

Returns

\Charcoal\Admin\Property\AbstractPropertyDisplay

Chainable

displayClass()

displayClass() : string

Returns

string

setDisplayName()

setDisplayName(string  $displayName) : \Charcoal\Admin\Property\AbstractPropertyInput

Set the display name.

Used for the HTML "name" attribute.

Parameters

string $displayName

HTML id attribute.

Returns

\Charcoal\Admin\Property\AbstractPropertyInput

Chainable

displayName()

displayName() : string

Retrieve the display name.

The input name should always be the property's ident.

Returns

string

displayVal()

displayVal() : string

Retrieve display value.

Returns

string

setDisplayType()

setDisplayType(string  $displayType) : \Charcoal\Admin\Property\AbstractPropertyDisplay

Parameters

string $displayType

The display type.

Throws

\InvalidArgumentException

If provided argument is not of type 'string'.

Returns

\Charcoal\Admin\Property\AbstractPropertyDisplay

Chainable

displayType()

displayType() : string

Returns

string

propertyIdent()

propertyIdent() : string

Returns

string

setProperty()

setProperty(\Charcoal\Property\PropertyInterface  $p) : \Charcoal\Admin\Property\AbstractPropertyDisplay

Parameters

\Charcoal\Property\PropertyInterface $p

The property.

Returns

\Charcoal\Admin\Property\AbstractPropertyDisplay

Chainable

property()

property() : \Charcoal\Property\PropertyInterface

Returns

\Charcoal\Property\PropertyInterface

p()

p() : \Charcoal\Property\PropertyInterface

Alias of {@see self::property()}

Returns

\Charcoal\Property\PropertyInterface

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

createMetadata()

createMetadata(array  $data = null) : \Charcoal\Property\PropertyMetadata

Parameters

array $data

Optional. Metadata data.

Returns

\Charcoal\Property\PropertyMetadata

getter()

getter(string  $key) : string

Allow an object to define how the key getter are called.

Parameters

string $key

The key to get the getter from.

Returns

string —

The getter method name, for a given key.

setter()

setter(string  $key) : string

Allow an object to define how the key setter are called.

Parameters

string $key

The key to get the setter from.

Returns

string —

The setter method name, for a given key.

camelize()

camelize(string  $str) : string

Transform a snake_case string to camelCase.

Parameters

string $str

The snake_case string to camelize.

Returns

string —

The camelCase string.