You are here

public function OembedProviderForm::removeCallback in oEmbed Providers 1.0.x

Same name and namespace in other branches
  1. 2.x src/OembedProviderForm.php \Drupal\oembed_providers\OembedProviderForm::removeCallback()
  2. 1.1.x src/OembedProviderForm.php \Drupal\oembed_providers\OembedProviderForm::removeCallback()

AJAX helper function for removing endpoints.

Parameters

array $form: A nested array form elements comprising the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

File

src/OembedProviderForm.php, line 299

Class

OembedProviderForm
Form controller for the oEmbed provider edit/add forms.

Namespace

Drupal\oembed_providers

Code

public function removeCallback(array &$form, FormStateInterface $form_state) {

  // Get triggering element, so the correct endpoint is removed.
  $trigger = $form_state
    ->getTriggeringElement();
  $form_state
    ->set('endpoint_remove', $trigger['#parents'][1]);
  $form_state
    ->setRebuild();
}