\Charcoal\Ui\DashboardDashboardInterface

Defines a dashboard.

Dashboards are simply a collection of widgets, in a layout.

  • layout is a LayoutInterface object that can be created with a LayoutBuilder.
  • widgets is a collection of any UiItemInterface objects.

Summary

Methods
Constants
setType()
type()
setActive()
active()
setTemplate()
template()
setTitle()
title()
setSubtitle()
subtitle()
setDescription()
description()
setNotes()
notes()
setShowTitle()
showTitle()
setShowSubtitle()
showSubtitle()
setShowDescription()
showDescription()
setShowNotes()
showNotes()
setShowHeader()
showHeader()
setShowFooter()
showFooter()
setLayoutBuilder()
setLayout()
layout()
setWidgets()
addWidget()
widgets()
hasWidgets()
numWidgets()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

setType()

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

Set the UI item type.

Parameters

string|null $type

The UI item type.

Returns

\Charcoal\Ui\UiItemInterface

Chainable

type()

type() : string

Retrieve the UI item type.

Returns

string

setActive()

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

Activates/deactivates the UI item.

Parameters

boolean $active

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

Returns

\Charcoal\Ui\UiItemInterface

Chainable

active()

active() : boolean

Determine if the UI item is active.

Returns

boolean

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).

Returns

\Charcoal\Ui\UiItemInterface

Chainable

template()

template() : string

Retrieve the UI item's template.

Returns

string

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

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

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

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

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

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

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.

Returns

\Charcoal\Ui\Layout\DashboardInterface —

Chainable

setWidgets()

setWidgets(array  $widgets) : \Charcoal\Ui\Dashboard\DashboardInterface

Set the dashboard's widgets.

Parameters

array $widgets

A collection of widgets.

Returns

\Charcoal\Ui\Dashboard\DashboardInterface

Chainable

addWidget()

addWidget(string  $widgetIdent, \Charcoal\Ui\UiItemInterface|array  $widget) : \Charcoal\Ui\Dashboard\DashboardInterface

Add a widget to the dashboard.

Parameters

string $widgetIdent

The widget identifier.

\Charcoal\Ui\UiItemInterface|array $widget

The widget object or structure.

Returns

\Charcoal\Ui\Dashboard\DashboardInterface

Chainable

widgets()

widgets() : array<mixed,\Charcoal\Ui\UiItemInterface>|\Charcoal\Ui\Dashboard\Generator

Retrieve the dashboard's widgets.

Returns

array<mixed,\Charcoal\Ui\UiItemInterface>|\Charcoal\Ui\Dashboard\Generator

hasWidgets()

hasWidgets() : boolean

Determine if the dashboard has any widgets.

Returns

boolean

numWidgets()

numWidgets() : integer

Count the number of widgets attached to the dashboard.

Returns

integer