Properties

$inputCallback

$inputCallback : callable

The input callback; called on every input.

Callable signature: function(FormInputInterface $input)

Type

callable

$l10nMode

$l10nMode : string

The L10N display mode.

Type

string

$ident

$ident : string

The group's identifier.

Type

string

$priority

$priority : integer

The group's priority.

Type

integer

$requiredAclPermissions

$requiredAclPermissions : array<mixed,string>

The required Acl permissions fetch from form group.

Type

array<mixed,string>

$tabCssClasses

$tabCssClasses : string|array<mixed,string>

Class or Classes for tab form group.

Type

string|array<mixed,string>

$active

$active : boolean

A UI item is active by default.

Type

boolean

$type

$type : string|null

The UI item type.

Type

string|null

$template

$template : string|null

The UI item's template.

Type

string|null

$title

$title : \Charcoal\Translator\Translation

The UI item's title.

Type

\Charcoal\Translator\Translation

$subtitle

$subtitle : \Charcoal\Translator\Translation

The UI item's sub-title.

Type

\Charcoal\Translator\Translation

$description

$description : \Charcoal\Translator\Translation

The UI item's description.

Type

\Charcoal\Translator\Translation

$notes

$notes : \Charcoal\Translator\Translation

The UI item's notes.

Type

\Charcoal\Translator\Translation

$showTitle

$showTitle : boolean

The title is displayed by default.

Type

boolean

$showSubtitle

$showSubtitle : boolean

The sub-title is displayed by default.

Type

boolean

$showDescription

$showDescription : boolean

The description is displayed by default.

Type

boolean

$showNotes

$showNotes : boolean

The notes are displayed by default.

Type

boolean

$showHeader

$showHeader : boolean

The header is displayed by default.

Type

boolean

$showFooter

$showFooter : boolean

The footer is displayed by default.

Type

boolean

$icon

$icon : string

The icon ident from font-awesome library

Type

string

Methods

__construct()

__construct(array|\ArrayAccess  $data = null) 

Return a new UI item.

Parameters

array|\ArrayAccess $data

The class depdendencies.

setData()

setData(array  $data) : self

Parameters

array $data

Widget data.

Returns

self

l10nMode()

l10nMode() : string

Returns

string

addInput()

addInput(string  $inputIdent, array|\Charcoal\Ui\FormInput\FormInputInterface  $input) : \Charcoal\Ui\FormGroup\FormGroupInterface

Parameters

string $inputIdent

The input identifier.

array|\Charcoal\Ui\FormInput\FormInputInterface $input

The input object or structure.

Throws

\InvalidArgumentException

If the ident argument is not a string or if the input is not valid.

Returns

\Charcoal\Ui\FormGroup\FormGroupInterface

Chainable

inputs()

inputs(callable  $inputCallback = null) : array<mixed,\Charcoal\Ui\FormGroup\FormGroupInterface>|\Charcoal\Ui\FormGroup\Generator

Form Input generator.

Parameters

callable $inputCallback

Optional. Input callback.

Returns

array<mixed,\Charcoal\Ui\FormGroup\FormGroupInterface>|\Charcoal\Ui\FormGroup\Generator

hasInputs()

hasInputs() : boolean

Wether this group contains any inputs.

Returns

boolean

numInputs()

numInputs() : integer

Get the number of inputs in this group.

Returns

integer

setIdent()

setIdent(string  $ident) : self

Set the identifier of the group.

Parameters

string $ident

The group identifier.

Returns

self

ident()

ident() : string

Retrieve the idenfitier of the group.

Returns

string

setPriority()

setPriority(integer  $priority) : self

Set the group's priority or sorting index.

Parameters

integer $priority

An index, for sorting.

Throws

\InvalidArgumentException

If the priority is not an integer.

Returns

self

priority()

priority() : integer

Retrieve the group's priority or sorting index.

Returns

integer

setTabCssClasses()

setTabCssClasses(string|array<mixed,\string>  $classes) : self

Parameters

string|array<mixed,\string> $classes

Class or Classes for tab form group.

Returns

self

tabCssClasses()

tabCssClasses() : string|array<mixed,\string>

Returns

string|array<mixed,\string>

setLayoutBuilder()

setLayoutBuilder(\Charcoal\Ui\Layout\LayoutBuilder  $builder) : \Charcoal\Ui\Layout\DashboardInterface

Parameters

\Charcoal\Ui\Layout\LayoutBuilder $builder

The layout builder, to create customized layout object(s).

Returns

\Charcoal\Ui\Layout\DashboardInterface —

Chainable

setLayout()

setLayout(\Charcoal\Ui\Layout\LayoutInterface|array  $layout) : \Charcoal\Ui\Layout\DashboardInterface

Parameters

\Charcoal\Ui\Layout\LayoutInterface|array $layout

The layout object or structure.

Throws

\InvalidArgumentException

If the layout argument is not an object or layout structure.

Returns

\Charcoal\Ui\Layout\DashboardInterface —

Chainable

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Inject dependencies from a DI Container.

Parameters

\Pimple\Container $container

A dependencies container instance.

setActive()

setActive(boolean  $active) : \Charcoal\Ui\AbstractUiItem

Activates/deactivates the UI item.

Parameters

boolean $active

Activate (TRUE) or deactivate (FALSE) the UI item.

Returns

\Charcoal\Ui\AbstractUiItem

Chainable

active()

active() : boolean

Determine if the UI item is active.

Returns

boolean

setType()

setType(string|null  $type) : \Charcoal\Ui\UiItemInterface

Set the UI item type.

Parameters

string|null $type

The UI item type.

Throws

\InvalidArgumentException

If the type is not a string.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

type()

type() : string

Retrieve the form group type.

Returns

string

setTemplate()

setTemplate(string  $template) : \Charcoal\Ui\UiItemInterface

Set the UI item's template.

Usually, a path to a file containing the template to be rendered.

Parameters

string $template

A template (identifier).

Throws

\InvalidArgumentException

If the template is not a string.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

template()

template() : string

Retrieve the UI item's template.

Returns

string —

If unset, returns the UI item type.

setTitle()

setTitle(mixed  $title) : \Charcoal\Ui\UiItemInterface

Set the UI item's title.

Parameters

mixed $title

A title.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

title()

title() : \Charcoal\Translator\Translation|null

Retrieve the title.

Returns

\Charcoal\Translator\Translation|null

setSubtitle()

setSubtitle(mixed  $subtitle) : \Charcoal\Ui\UiItemInterface

Set the UI item's sub-title.

Parameters

mixed $subtitle

A sub-title.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

subtitle()

subtitle() : \Charcoal\Translator\Translation|null

Retrieve the sub-title.

Returns

\Charcoal\Translator\Translation|null

setDescription()

setDescription(mixed  $description) : \Charcoal\Ui\UiItemInterface

Set the UI item's description.

Parameters

mixed $description

A description.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

description()

description() : \Charcoal\Translator\Translation|null

Retrieve the description.

Returns

\Charcoal\Translator\Translation|null

setNotes()

setNotes(mixed  $notes) : \Charcoal\Ui\UiItemInterface

Set notes about the UI item.

Parameters

mixed $notes

Notes.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

notes()

notes() : \Charcoal\Translator\Translation|null

Retrieve the notes.

Returns

\Charcoal\Translator\Translation|null

setShowTitle()

setShowTitle(boolean  $show) : \Charcoal\Ui\UiItemInterface

Show/hide the UI item's title.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the title.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

showTitle()

showTitle() : boolean

Determine if the title is to be displayed.

Returns

boolean —

If TRUE or unset, check if there is a title.

setShowSubtitle()

setShowSubtitle(boolean  $show) : \Charcoal\Ui\UiItemInterface

Show/hide the UI item's sub-title.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the sub-title.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

showSubtitle()

showSubtitle() : boolean

Determine if the sub-title is to be displayed.

Returns

boolean —

If TRUE or unset, check if there is a sub-title.

setShowDescription()

setShowDescription(boolean  $show) : \Charcoal\Ui\UiItemInterface

Show/hide the UI item's description.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the description.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

showDescription()

showDescription() : boolean

Determine if the description is to be displayed.

Returns

boolean —

If TRUE or unset, check if there is a description.

setShowNotes()

setShowNotes(boolean  $show) : \Charcoal\Ui\UiItemInterface

Show/hide the UI item's notes.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the notes.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

showNotes()

showNotes() : boolean

Determine if the notes is to be displayed.

Returns

boolean —

If TRUE or unset, check if there are notes.

setShowHeader()

setShowHeader(boolean  $show) : \Charcoal\Ui\UiItemInterface

Show/hide the UI item's header.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the header.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

showHeader()

showHeader() : boolean

Determine if the header is to be displayed.

Returns

boolean —

If TRUE or unset, check if there is a title.

setShowFooter()

setShowFooter(boolean  $show) : \Charcoal\Ui\UiItemInterface

Show/hide the UI item's footer.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the footer.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

showFooter()

showFooter() : boolean

Determine if the footer is to be displayed.

Returns

boolean —

If TRUE or unset, check if there are notes.

icon()

icon() : string

Retrieve the path to the item's icon.

Returns

string

setIcon()

setIcon(string  $icon) : \Charcoal\Ui\UiItemInterface

Set the path to the item's icon associated with the object.

Parameters

string $icon

A path to an image.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

translator()

translator() : \Charcoal\Translator\Translator

Returns

\Charcoal\Translator\Translator