public function FileUrlWidget::formMultipleElements in File URL 8
Same name and namespace in other branches
- 2.0.x src/Plugin/Field/FieldWidget/FileUrlWidget.php \Drupal\file_url\Plugin\Field\FieldWidget\FileUrlWidget::formMultipleElements()
Overrides \Drupal\Core\Field\WidgetBase::formMultipleElements().
Special handling for draggable multiple widgets and 'add more' button.
Overrides FileWidget::formMultipleElements
File
- src/
Plugin/ Field/ FieldWidget/ FileUrlWidget.php, line 69
Class
- FileUrlWidget
- Plugin implementation of the 'file_url_generic' widget.
Namespace
Drupal\file_url\Plugin\Field\FieldWidgetCode
public function formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) {
$elements = parent::formMultipleElements($items, $form, $form_state);
// Use the configurable 'new item' label.
$elements['#file_upload_title'] = $this
->getSetting('add_new_label');
// The upload instructions are added directly to 'file_url' element.
unset($elements['#file_upload_description']);
return $elements;
}