protected function NiceImageWidget::formMultipleElements in Nice ImageField Widget 8
Overrides \Drupal\file\Plugin\Field\FieldWidget\FileWidget::formMultipleElements().
Special handling for draggable multiple widgets and 'add more' button.
Parameters
FieldItemListInterface $items:
array $form:
FormStateInterface $form_state:
Return value
array
Overrides ImageWidget::formMultipleElements
File
- src/
Plugin/ Field/ FieldWidget/ NiceImageWidget.php, line 59 - Contains \Drupal\nice_imagefield_widget\Plugin\Field\FieldWidget\NiceImageWidget.
Class
- NiceImageWidget
- Plugin implementation of the 'nice_image_widget' widget.
Namespace
Drupal\nice_imagefield_widget\Plugin\Field\FieldWidgetCode
protected function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) {
$elements = parent::formMultipleElements($items, $form, $form_state);
$elements['#theme'] = 'nice_imagefield_widget_multiple';
$elements['#attached']['library'][] = 'nice_imagefield_widget/sortable';
return $elements;
}