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.
Public Methods ​
Method | Description |
---|---|
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.
Arguments ​
$element
(craft\base\ElementInterface, null) – The element the form is being rendered for$static
(boolean) – Whether the form should be static (non-interactive)
Returns ​
hasCustomWidth()
​
Returns whether the element can have a custom width.
Returns ​
selectorHtml()
​
Returns the selector HTML that should be displayed within field layout designers.
Returns ​
settingsHtml()
​
Returns the settings HTML for the layout element.