You are here

public function ParagraphsPreviewerWidgetTrait::formMultipleElements in Paragraphs Previewer 8

File

src/Plugin/Field/FieldWidget/ParagraphsPreviewerWidgetTrait.php, line 50

Class

ParagraphsPreviewerWidgetTrait
Paragraphs previewer trait to support multiple paragraphs widgets.

Namespace

Drupal\paragraphs_previewer\Plugin\Field\FieldWidget

Code

public function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) {
  $elements = parent::formMultipleElements($items, $form, $form_state);
  $elements['#attached']['library'][] = 'paragraphs_previewer/widget';
  return $elements;
}