You are here

CourseEntityForm.php in Course 8.3

Same filename and directory in other branches
  1. 8.2 src/Form/CourseEntityForm.php
  2. 3.x src/Form/CourseEntityForm.php

Namespace

Drupal\course\Form

File

src/Form/CourseEntityForm.php
View source
<?php

namespace Drupal\course\Form;

use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
class CourseEntityForm extends ContentEntityForm {

  /**
   * {@inheritdoc}
   *
   * Redirect to the outline form after course creation.
   */
  public function save(array $form, FormStateInterface $form_state) {
    parent::save($form, $form_state);
    $form_state
      ->setRedirect('course.outline', [
      'course' => $this->entity
        ->id(),
    ]);
  }

}

Classes

Namesort descending Description
CourseEntityForm