public function DeleteForm::submitForm in Linkit 8.4
Same name in this branch
- 8.4 src/Form/Attribute/DeleteForm.php \Drupal\linkit\Form\Attribute\DeleteForm::submitForm()
- 8.4 src/Form/Matcher/DeleteForm.php \Drupal\linkit\Form\Matcher\DeleteForm::submitForm()
Same name and namespace in other branches
- 8.5 src/Form/Matcher/DeleteForm.php \Drupal\linkit\Form\Matcher\DeleteForm::submitForm()
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/ Matcher/ DeleteForm.php, line 75 - Contains \Drupal\linkit\Form\Matcher\DeleteForm.
Class
- DeleteForm
- Provides a form to remove a matcher from a profile.
Namespace
Drupal\linkit\Form\MatcherCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->linkitProfile
->removeMatcher($this->linkitMatcher);
drupal_set_message($this
->t('The matcher %label has been deleted.', [
'%label' => $this->linkitMatcher
->getLabel(),
]));
$this
->logger('linkit')
->notice('The matcher %label has been deleted in the @profile profile.', [
'%label' => $this->linkitMatcher
->getLabel(),
'@profile' => $this->linkitProfile
->label(),
]);
$form_state
->setRedirect('linkit.matchers', [
'linkit_profile' => $this->linkitProfile
->id(),
]);
}