public static function VideoUploadWidget::validateDirectory in Video 8
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldWidget/VideoUploadWidget.php \Drupal\video\Plugin\Field\FieldWidget\VideoUploadWidget::validateDirectory()
Form API callback
Removes slashes from the beginning and end of the destination value and ensures that the file directory path is not included at the beginning of the value.
This function is assigned as an #element_validate callback in settingsForm().
File
- src/
Plugin/ Field/ FieldWidget/ VideoUploadWidget.php, line 103
Class
- VideoUploadWidget
- Plugin implementation of the 'video_upload' widget.
Namespace
Drupal\video\Plugin\Field\FieldWidgetCode
public static function validateDirectory($element, FormStateInterface $form_state) {
// Strip slashes from the beginning and end of $element['file_directory'].
$value = trim($element['#value'], '\\/');
$form_state
->setValueForElement($element, $value);
}