\Charcoal\Admin\UiNestedWidgetContainerInterface

Widget Container Interface

Implementation, as trait, provided by \Charcoal\Admin\Ui\NestedWidgetContainerTrait.

Summary

Methods
Constants
widget()
setWidgetData()
mergeWidgetData()
addWidgetData()
widgetData()
widgetDataAsJson()
renderableData()
setRenderableData()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

widget()

widget() : \Charcoal\App\Template\WidgetInterface

Retrieve the nested widget.

Returns

\Charcoal\App\Template\WidgetInterface

setWidgetData()

setWidgetData(array  $settings) : self

Set the nested widget's options.

This method always merges default settings.

Parameters

array $settings

The nested widget options.

Returns

self

mergeWidgetData()

mergeWidgetData(array  $settings) : self

Merge (replacing or adding) nested widget options.

Parameters

array $settings

The nested widget options.

Returns

self

addWidgetData()

addWidgetData(string  $key, mixed  $val) : self

Add (or replace) an nested widget option.

Parameters

string $key

The setting to add/replace.

mixed $val

The setting's value to apply.

Returns

self

widgetData()

widgetData(string|null  $key) : mixed

Retrieve the nested widget's options or a single option.

Parameters

string|null $key

The option key to lookup.

Returns

mixed

widgetDataAsJson()

widgetDataAsJson() : string

Retrieve the nested widget's options as a JSON string.

Returns

string —

Returns data serialized with {@see json_encode()}.

renderableData()

renderableData() : array

Retrieve the nested widget's renderable options.

Returns

array

setRenderableData()

setRenderableData(array  $data) : self

Set the nested widget's renderable options.

Parameters

array $data

The data to render.

Returns

self