Overview

Namespaces

  • Charcoal
    • Ui
      • Dashboard
      • Form
      • FormGroup
      • FormInput
      • Layout
      • Menu
      • MenuItem
      • ServiceProvider

Classes

  • AbstractDashboard
  • DashboardBuilder
  • DashboardConfig
  • FormInputConfig
  • GenericDashboard

Interfaces

  • DashboardInterface

Traits

  • DashboardTrait
  • Overview
  • Namespace
  • Class

Trait DashboardTrait

Provides an implementation of Charcoal\Ui\Dashboard\DashboardInterface.

Direct Known Users

Charcoal\Ui\Dashboard\AbstractDashboard

Indirect Known Users

Charcoal\Ui\Dashboard\GenericDashboard
Namespace: Charcoal\Ui\Dashboard
Located at Charcoal/Ui/Dashboard/DashboardTrait.php
Methods summary
protected Charcoal\Ui\Dashboard\DashboardInterface
# setWidgetBuilder( object $builder )

Set a widget builder.

Set a widget builder.

Parameters

$builder
The builder to create customized widget objects.

Returns

Charcoal\Ui\Dashboard\DashboardInterface
Chainable

Throws

InvalidArgumentException
If the argument is not a widget builder.
public Charcoal\Ui\Dashboard\DashboardInterface
# setWidgetCallback( callable|null $callable )

Set a callback to be applied to each widget output by self::widgets().

Set a callback to be applied to each widget output by self::widgets().

Parameters

$callable

A callback to be applied to each widget or NULL to disable the callback.

Returns

Charcoal\Ui\Dashboard\DashboardInterface
Chainable

Throws

InvalidArgumentException
If the argument is not callable or NULL.
public Charcoal\Ui\Dashboard\DashboardInterface
# setWidgets( array $widgets )

Set the dashboard's widgets.

Set the dashboard's widgets.

Parameters

$widgets
A collection of widgets.

Returns

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

Add a widget to the dashboard.

Add a widget to the dashboard.

If a widget with the same $widgetIdent already exists, it will be overridden.

Parameters

$widgetIdent
The widget identifier.
$widget
The widget object or structure.

Returns

Charcoal\Ui\Dashboard\DashboardInterface
Chainable

Throws

InvalidArgumentException
If the widget is invalid.
public Charcoal\Ui\UiItemInterface[]|Generator
# widgets( callable $widgetCallback = null )

Retrieve the dashboard's widgets.

Retrieve the dashboard's widgets.

Parameters

$widgetCallback
A callback applied to each widget.

Returns

Charcoal\Ui\UiItemInterface[]|Generator
public boolean
# hasWidgets( )

Determine if the dashboard has any widgets.

Determine if the dashboard has any widgets.

Returns

boolean
public integer
# numWidgets( )

Count the number of widgets attached to the dashboard.

Count the number of widgets attached to the dashboard.

Returns

integer
protected static integer
# sortWidgetsByPriority( mixed $a, mixed $b )

Static comparison function used by uasort().

Static comparison function used by uasort().

Parameters

$a
Widget A.
$b
Widget B.

Returns

integer
Sorting value: -1 or 1
Properties summary
protected object $widgetBuilder

Store a widget builder instance.

Store a widget builder instance.

#
API documentation generated by ApiGen