function ContactForm::save
Same name in other branches
- 3.x modules/content_entity_example/src/Form/ContactForm.php \Drupal\content_entity_example\Form\ContactForm::save()
- 8.x-1.x content_entity_example/src/Form/ContactForm.php \Drupal\content_entity_example\Form\ContactForm::save()
Overrides EntityForm::save
File
-
modules/
content_entity_example/ src/ Form/ ContactForm.php, line 36
Class
- ContactForm
- Form controller for the content_entity_example entity edit forms.
Namespace
Drupal\content_entity_example\FormCode
public function save(array $form, FormStateInterface $form_state) {
$form_state->setRedirect('entity.content_entity_example_contact.collection');
$entity = $this->getEntity();
return $entity->save();
}