You are here

public function EntityReferenceBrowserTableWidget::formElement in Entity Browser - Table Layout 8

File

src/Plugin/Field/FieldWidget/EntityReferenceBrowserTableWidget.php, line 129

Class

EntityReferenceBrowserTableWidget
Plugin implementation of the 'entity_reference_browser_table_widget' widget.

Namespace

Drupal\entity_browser_table\Plugin\Field\FieldWidget

Code

public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
  $element = parent::formElement($items, $delta, $element, $form, $form_state);
  $element['#attributes']['class'] = [
    'field--widget-entity_reference_browser_table_widget',
  ];
  $element['#attached']['library'][] = 'entity_browser_table/entity_browser_table';
  return $element;
}