BaseSettingFactory

Base factory class to generate widget settings.
Contains interfaces for all common properties of a setting.

Namespace

Ceres\Widgets\Helper\Factories\Settings

Properties
Type Name Description

``

$data

Methods
public static create($data = [])
Parameters

Type

Name

Description

``

$data

public withType($type):Settings

Set the type of the setting.

Parameters

Type

Name

Description

string

$type

public withOption($key, $value):Settings

Set an option for the setting.

Parameters

Type

Name

Description

string

$key

The option key

mixed

$value

The option value

public withDefaultValue($defaultValue):Settings

Set the default value for the setting.

Parameters

Type

Name

Description

mixed

$defaultValue

The default value

public withCondition($condition):Settings

Set a condition if the setting should be visible or not.

Parameters

Type

Name

Description

string

$condition

Condition if the related form element should be visible or not.

public withName($name):Settings

Set the name of the setting.

Parameters

Type

Name

Description

string

$name

The label of the setting

public withTooltip($tooltip):Settings

Set a tooltip text for this input

Parameters

Type

Name

Description

string

$tooltip

An additional description of the setting

public withList($min, $max):Settings

Determines whether the declaration is used to render a list of the specified form field.

Parameters

Type

Name

Description

int

$min

Minimum number of entries.

int

$max

Maximum number of entries. If not set or smaller than 0, unlimited entries might be added by the user.

public toArray():array

Get all data as a native array