You are here

public function EditFolderForm::submitForm in Taxonomy File Tree 8

Same name and namespace in other branches
  1. 3.x src/Form/EditFolderForm.php \Drupal\tft\Form\EditFolderForm::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/EditFolderForm.php, line 70

Class

EditFolderForm
Edit a term form.

Namespace

Drupal\tft\Form

Code

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

  // Update the term name.
  $term = Term::load($form_state
    ->getValue('tid'));
  $term
    ->setName($form_state
    ->getValue('name'));
  $term
    ->save();
  $this
    ->messenger()
    ->addMessage(t("The folder '@name' was updated.", [
    '@name' => $form_state
      ->getValue('name'),
  ]));
}