Skip to content

PreviewableFieldInterface ​

Type
Interface
Namespace
craft\base
Implemented by
craft\fields\Assets, craft\fields\BaseOptionsField, craft\fields\BaseRelationField, craft\fields\Categories, craft\fields\Checkboxes, craft\fields\Color, craft\fields\Country, craft\fields\Date, craft\fields\Dropdown, craft\fields\Email, craft\fields\Entries, craft\fields\Lightswitch, craft\fields\Money, craft\fields\MultiSelect, craft\fields\Number, craft\fields\PlainText, craft\fields\RadioButtons, craft\fields\Tags, craft\fields\Time, craft\fields\Url, craft\fields\Users
Since
3.0.0

PreviewableFieldInterface defines the common interface to be implemented by field classes that wish to be previewable on element indexes in the control panel.

View source

Public Methods ​

MethodDescription
getTableAttributeHtml()Returns the HTML that should be shown for this field in Table View.

getTableAttributeHtml() ​

Returns the HTML that should be shown for this field in Table View.

View source

Arguments ​

  • $value (mixed) – The field’s value
  • $element (craft\base\ElementInterface) – The element the field is associated with

Returns ​

string – The HTML that should be shown for this field in Table View