function ActionFormBase::save

Same name in other branches
  1. 9 core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::save()
  2. 8.9.x core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::save()
  3. 10 core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::save()

Overrides EntityForm::save

File

core/modules/action/src/Form/ActionFormBase.php, line 133

Class

ActionFormBase
Provides a base form for action forms.

Namespace

Drupal\action\Form

Code

public function save(array $form, FormStateInterface $form_state) {
    $this->entity
        ->save();
    $this->messenger()
        ->addStatus($this->t('The action has been successfully saved.'));
    $form_state->setRedirect('entity.action.collection');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.