You are here

public function GroupForm::form in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Form/GroupForm.php \Drupal\rng\Form\GroupForm::form()
  2. 3.x src/Form/GroupForm.php \Drupal\rng\Form\GroupForm::form()

Gets the actual form array to be built.

Overrides ContentEntityForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

src/Form/GroupForm.php, line 22

Class

GroupForm
Form controller for registration groups.

Namespace

Drupal\rng\Form

Code

public function form(array $form, FormStateInterface $form_state, GroupInterface $group = NULL) {
  $group = $this->entity;
  if (!$group
    ->isNew()) {
    $form['#title'] = $this
      ->t('Edit group %label', array(
      '%label' => $group
        ->label(),
    ));
  }
  $form = parent::form($form, $form_state, $group);
  return $form;
}