Implement save function to add message and redirect to collection page
This commit is contained in:
parent
1cee2cb2e1
commit
52f968ef6c
|
@ -170,6 +170,17 @@ class QuickFormEntityForm extends EntityForm {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save(array $form, FormStateInterface $form_state) {
|
||||
$status = parent::save($form, $form_state);
|
||||
$entity_type_label = $this->entity->getEntityType()->getSingularLabel();
|
||||
$this->messenger()->addMessage($this->t('Saved @entity_type_label: %label', ['@entity_type_label' => $entity_type_label, '%label' => $this->entity->label()]));
|
||||
$form_state->setRedirect('entity.quick_form.collection');
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue