You are here

public function LogActionFormBase::buildForm in Log entity 2.x

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

1 call to LogActionFormBase::buildForm()
LogRescheduleActionForm::buildForm in src/Form/LogRescheduleActionForm.php
Form constructor.
1 method overrides LogActionFormBase::buildForm()
LogRescheduleActionForm::buildForm in src/Form/LogRescheduleActionForm.php
Form constructor.

File

src/Form/LogActionFormBase.php, line 108

Class

LogActionFormBase
Base form class for configurable actions.

Namespace

Drupal\log\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['date'] = [
    '#type' => 'datelist',
    '#title' => $this
      ->t('New date'),
    '#default_value' => new DrupalDateTime(),
    '#date_part_order' => [
      'year',
      'month',
      'day',
    ],
    '#required' => TRUE,
    '#date_year_range' => '-15:+15',
  ];
  return parent::buildForm($form, $form_state);
}