function EntityDisplayModeFormBase::save
Same name in other branches
- 9 core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php \Drupal\field_ui\Form\EntityDisplayModeFormBase::save()
- 10 core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php \Drupal\field_ui\Form\EntityDisplayModeFormBase::save()
- 11.x core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php \Drupal\field_ui\Form\EntityDisplayModeFormBase::save()
Overrides EntityForm::save
File
-
core/
modules/ field_ui/ src/ Form/ EntityDisplayModeFormBase.php, line 80
Class
- EntityDisplayModeFormBase
- Provides the generic base class for entity display mode forms.
Namespace
Drupal\field_ui\FormCode
public function save(array $form, FormStateInterface $form_state) {
$this->messenger()
->addStatus($this->t('Saved the %label @entity-type.', [
'%label' => $this->entity
->label(),
'@entity-type' => $this->entityType
->getSingularLabel(),
]));
$this->entity
->save();
\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
$form_state->setRedirectUrl($this->entity
->toUrl('collection'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.