FieldLayoutElementInterface

Type
Interface
Namespace
craft\base
Extends
yii\base\Arrayable (opens new window)
Implemented by
craft\base\FieldLayoutElement, craft\fieldlayoutelements\BaseField, craft\fieldlayoutelements\BaseUiElement, craft\fieldlayoutelements\CustomField, craft\fieldlayoutelements\EntryTitleField, craft\fieldlayoutelements\Heading, craft\fieldlayoutelements\HorizontalRule, craft\fieldlayoutelements\StandardField, craft\fieldlayoutelements\StandardTextField, craft\fieldlayoutelements\Template, craft\fieldlayoutelements\Tip, craft\fieldlayoutelements\TitleField
Since
3.5.0

FieldLayoutElementInterface defines the common interface to be implemented by field layout element classes.

View source (opens new window)

# Public Methods

Method Description
extraFields() (opens new window) Returns the list of additional fields that can be returned by toArray() (opens new window) in addition to those listed in fields() (opens new window).
fields() (opens new window) Returns the list of fields that should be returned by default by toArray() (opens new window) when no specific fields are specified.
formHtml() Returns the element’s form HTMl.
hasCustomWidth() Returns whether the element can have a custom width.
selectorHtml() Returns the selector HTML that should be displayed within field layout designers.
settingsHtml() Returns the settings HTML for the layout element.
toArray() (opens new window) Converts the object into an array.

# formHtml()

Returns the element’s form HTMl.

Return null if the element should not be present within the form.

View source (opens new window)

Arguments

Returns

string (opens new window), null (opens new window)

# hasCustomWidth()

Returns whether the element can have a custom width.

View source (opens new window)

Returns

boolean (opens new window)

# selectorHtml()

Returns the selector HTML that should be displayed within field layout designers.

View source (opens new window)

Returns

string (opens new window)

# settingsHtml()

Returns the settings HTML for the layout element.

View source (opens new window)

Returns

string (opens new window), null (opens new window)