You are here

protected function ButtonFieldHtml::elementProperties in Button Field 8

Same name in this branch
  1. 8 src/Plugin/Field/FieldFormatter/ButtonFieldHtml.php \Drupal\button_field\Plugin\Field\FieldFormatter\ButtonFieldHtml::elementProperties()
  2. 8 src/Plugin/Field/FieldWidget/ButtonFieldHtml.php \Drupal\button_field\Plugin\Field\FieldWidget\ButtonFieldHtml::elementProperties()

Retrieves the properties for the current widget's element.

Return value

array Properties for the widget element.

Overrides ButtonFieldBase::elementProperties

File

src/Plugin/Field/FieldWidget/ButtonFieldHtml.php, line 61
Contains Drupal\button_field\Plugin\Field\FieldWidget\ButtonFieldHtml.

Class

ButtonFieldHtml
Plugin implementation of the 'button html' widget.

Namespace

Drupal\button_field\Plugin\Field\FieldWidget

Code

protected function elementProperties() {
  return array(
    '#type' => 'button',
    '#value' => $this
      ->getSetting('text') ?: $this->fieldDefinition
      ->getLabel(),
  );
}