Skip to content

FieldLayoutElementInterface

Type
Interface
Namespace
craft\base
Extends
yii\base\Arrayable
Implemented by
craft\base\FieldLayoutElement, craft\fieldlayoutelements\AssetTitleField, 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

Public Methods

MethodDescription
extraFields()Returns the list of additional fields that can be returned by toArray() in addition to those listed in fields().
fields()Returns the list of fields that should be returned by default by toArray() 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()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

Arguments

Returns

string, null

hasCustomWidth()

Returns whether the element can have a custom width.

View source

Returns

boolean

selectorHtml()

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

View source

Returns

string

settingsHtml()

Returns the settings HTML for the layout element.

View source

Returns

string, null