3 namespace Drupal\fontyourface\Form;
5 use Drupal\Core\Entity\ContentEntityForm;
6 use Drupal\Core\Form\FormStateInterface;
9 * Form controller for Font edit forms.
11 * @ingroup fontyourface
13 class FontForm extends ContentEntityForm {
18 public function buildForm(array $form, FormStateInterface $form_state) {
19 /* @var $entity \Drupal\fontyourface\Entity\Font */
20 $form = parent::buildForm($form, $form_state);
21 $entity = $this->entity;
29 public function save(array $form, FormStateInterface $form_state) {
30 $entity = $this->entity;
31 $status = parent::save($form, $form_state);
35 drupal_set_message($this->t('Created the %label Font.', [
36 '%label' => $entity->label(),
41 drupal_set_message($this->t('Saved the %label Font.', [
42 '%label' => $entity->label(),
45 $form_state->setRedirect('entity.font.canonical', ['font' => $entity->id()]);