You are here

public function DateRecurInterpreterEditForm::form in Recurring Dates Field 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/DateRecurInterpreterEditForm.php \Drupal\date_recur\Form\DateRecurInterpreterEditForm::form()
  2. 3.0.x src/Form/DateRecurInterpreterEditForm.php \Drupal\date_recur\Form\DateRecurInterpreterEditForm::form()
  3. 3.1.x src/Form/DateRecurInterpreterEditForm.php \Drupal\date_recur\Form\DateRecurInterpreterEditForm::form()

Gets the actual form array to be built.

Overrides EntityForm::form

See also

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

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

1 call to DateRecurInterpreterEditForm::form()
DateRecurInterpreterAddForm::form in src/Form/DateRecurInterpreterAddForm.php
Gets the actual form array to be built.
1 method overrides DateRecurInterpreterEditForm::form()
DateRecurInterpreterAddForm::form in src/Form/DateRecurInterpreterAddForm.php
Gets the actual form array to be built.

File

src/Form/DateRecurInterpreterEditForm.php, line 61

Class

DateRecurInterpreterEditForm
Edit form for date recur interpreter entities.

Namespace

Drupal\date_recur\Form

Code

public function form(array $form, FormStateInterface $form_state) : array {
  $form = parent::form($form, $form_state);
  $dateRecurInterpreter = $this
    ->getEntity();
  $form['label'] = [
    '#title' => $this
      ->t('Label'),
    '#type' => 'textfield',
    '#default_value' => $dateRecurInterpreter
      ->label(),
  ];
  $plugin = $dateRecurInterpreter
    ->getPlugin();
  $key = 'configure';
  if ($plugin
    ->hasFormClass($key)) {
    $form['configure'] = [
      '#tree' => TRUE,
    ];
    $subformState = SubformState::createForSubform($form['configure'], $form, $form_state);
    $form['configure'] += $this->pluginFormFactory
      ->createInstance($plugin, $key)
      ->buildConfigurationForm($form['configure'], $subformState);
  }
  return $form;
}