You are here

public function RngContactForm::form in RNG Contact 8

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/RngContactForm.php, line 24

Class

RngContactForm
Form controller for contacts.

Namespace

Drupal\rng_contact\Form

Code

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