You are here

public static function WidgetsConfig::submitDeleteWidget in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Form/WidgetsConfig.php \Drupal\entity_browser\Form\WidgetsConfig::submitDeleteWidget()

AJAX submit callback for removing widgets from the entity browser.

File

src/Form/WidgetsConfig.php, line 191

Class

WidgetsConfig
Form for configuring widgets for entity browser.

Namespace

Drupal\entity_browser\Form

Code

public static function submitDeleteWidget($form, FormStateInterface $form_state) {
  $entity_browser = $form_state
    ->getFormObject()
    ->getEntity();
  $entity_browser
    ->deleteWidget($entity_browser
    ->getWidget($form_state
    ->getTriggeringElement()['#arguments']));
  $form_state
    ->setRebuild();
}