You are here

public function LingotekProfileEditForm::save in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  2. 8.2 src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  3. 4.0.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  4. 3.0.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  5. 3.1.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  6. 3.2.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  7. 3.3.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  8. 3.5.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  9. 3.6.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  10. 3.7.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()
  11. 3.8.x src/Form/LingotekProfileEditForm.php \Drupal\lingotek\Form\LingotekProfileEditForm::save()

Form submission handler for the 'save' action.

Normally this method should be overridden to provide specific messages to the user and redirect the form after the entity has been saved.

Parameters

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

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

Return value

int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Overrides LingotekProfileFormBase::save

File

src/Form/LingotekProfileEditForm.php, line 22

Class

LingotekProfileEditForm
Provides a form for lingotek profiles edition.

Namespace

Drupal\lingotek\Form

Code

public function save(array $form, FormStateInterface $form_state) {
  parent::save($form, $form_state);
  $this
    ->messenger()
    ->addStatus($this
    ->t('The Lingotek profile has been successfully edited.'));
  $form_state
    ->setRedirect('lingotek.settings');
}