WidgetSetting implements JsonSerializable
Interface WidgetSetting
Each setting that can be edited by a user should be defined in a WidgetSetting.
When using this framework, the settings interface is generated by the Dashboard app.
Each WidgetSetting must be generated and declared in the WidgetTemplate during the setup of the widget in the IDashboardWidget using addSetting().
Tags
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- TYPE_CHECKBOX = 'checkbox'
- TYPE_INPUT = 'input'
- $default : string
- $name : string
- $placeholder : string
- $title : string
- $type : string
- __construct() : mixed
- WidgetSetting constructor.
- getDefault() : string
- Get the default value.
- getName() : string
- Get the name of the setting
- getPlaceholder() : string
- Get the placeholder.
- getTitle() : string
- Get the title of the setting
- getType() : string
- Get the type of the setting.
- jsonSerialize() : array
- setDefault() : WidgetSetting
- Set the default value of the setting.
- setName() : WidgetSetting
- Set the name of the setting (full string, no space)
- setPlaceholder() : WidgetSetting
- Set the placeholder (in case of type=input)
- setTitle() : WidgetSetting
- Set the title/display name of the setting.
- setType() : WidgetSetting
- Set the type of the setting (input, checkbox, ...)
Constants
TYPE_CHECKBOX
public
mixed
TYPE_CHECKBOX
= 'checkbox'
TYPE_INPUT
public
mixed
TYPE_INPUT
= 'input'
Properties
$default
private
string
$default
= ''
$name
private
string
$name
= ''
$placeholder
private
string
$placeholder
= ''
$title
private
string
$title
= ''
$type
private
string
$type
= ''
Methods
__construct()
WidgetSetting constructor.
public
__construct([string $type = '' ]) : mixed
Parameters
- $type : string = ''
Tags
Return values
mixed —getDefault()
Get the default value.
public
getDefault() : string
Tags
Return values
string —getName()
Get the name of the setting
public
getName() : string
Tags
Return values
string —getPlaceholder()
Get the placeholder.
public
getPlaceholder() : string
Tags
Return values
string —getTitle()
Get the title of the setting
public
getTitle() : string
Tags
Return values
string —getType()
Get the type of the setting.
public
getType() : string
Tags
Return values
string —jsonSerialize()
public
jsonSerialize() : array
Tags
Return values
array —setDefault()
Set the default value of the setting.
public
setDefault(string $value) : WidgetSetting
Parameters
- $value : string
Tags
Return values
WidgetSetting —setName()
Set the name of the setting (full string, no space)
public
setName(string $name) : WidgetSetting
Parameters
- $name : string
Tags
Return values
WidgetSetting —setPlaceholder()
Set the placeholder (in case of type=input)
public
setPlaceholder(string $text) : WidgetSetting
Parameters
- $text : string
Tags
Return values
WidgetSetting —setTitle()
Set the title/display name of the setting.
public
setTitle(string $title) : WidgetSetting
Parameters
- $title : string
Tags
Return values
WidgetSetting —setType()
Set the type of the setting (input, checkbox, ...)
public
setType(string $type) : WidgetSetting
Parameters
- $type : string