Nextcloud PHP API (stable18)

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
see
IDashboardWidget::getWidgetTemplate
see
WidgetTemplate::addSetting
since
15.0.0

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

Properties

Methods

__construct()

WidgetSetting constructor.

public __construct([string $type = '' ]) : mixed
Parameters
$type : string = ''
Tags
since
15.0.0
Return values
mixed

getDefault()

Get the default value.

public getDefault() : string
Tags
since
15.0.0
Return values
string

getName()

Get the name of the setting

public getName() : string
Tags
since
15.0.0
Return values
string

getPlaceholder()

Get the placeholder.

public getPlaceholder() : string
Tags
since
15.0.0
Return values
string

getTitle()

Get the title of the setting

public getTitle() : string
Tags
since
15.0.0
Return values
string

getType()

Get the type of the setting.

public getType() : string
Tags
since
15.0.0
Return values
string

jsonSerialize()

public jsonSerialize() : array
Tags
since
15.0.0
Return values
array

setPlaceholder()

Set the placeholder (in case of type=input)

public setPlaceholder(string $text) : WidgetSetting
Parameters
$text : string
Tags
since
15.0.0
Return values
WidgetSetting

Search results