public function JavascriptLibrariesDeleteForm::submitForm in JavaScript Libraries Manager 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/ JavascriptLibrariesDeleteForm.php, line 70 - Contains \Drupal\javascript_libraries\Form\JavascriptLibrariesDeleteForm.
Class
Namespace
Drupal\javascript_libraries\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$custom = \Drupal::config('javascript_libraries.settings')
->get('javascript_libraries_custom_libraries');
$library_id = $this->id;
unset($custom[$library_id]);
\Drupal::configFactory()
->getEditable('javascript_libraries.settings')
->set('javascript_libraries_custom_libraries', $custom)
->save();
drupal_set_message("The library has been deleted succesfully");
return $form_state
->setRedirect('javascript_libraries.custom_form');
}