You are here

public function CclDeleteConfirm::submitForm in Custom Contextual Links 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides FormInterface::submitForm

File

src/Form/CclDeleteConfirm.php, line 36
Contains \Drupal\ccl\Form\CclDeleteConfirm.

Class

CclDeleteConfirm

Namespace

Drupal\ccl\Form

Code

public function submitForm(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) {
  if ($form_state
    ->getValue([
    'confirm',
  ])) {
    db_delete('ccl')
      ->condition('clid', $form_state
      ->getValue([
      'clid',
    ]))
      ->execute();
    drupal_set_message(t('Link removed.'));
    _ccl_update_cache();
    drupal_goto('admin/config/user-interface/ccl');
  }
}