You are here

public function TwigFieldForm::buildForm in Display Suite 8.4

Same name and namespace in other branches
  1. 8.3 src/Form/TwigFieldForm.php \Drupal\ds\Form\TwigFieldForm::buildForm()

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 FieldFormBase::buildForm

File

src/Form/TwigFieldForm.php, line 27

Class

TwigFieldForm
Configures token fields.

Namespace

Drupal\ds\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $field_key = '') {
  $form = parent::buildForm($form, $form_state, $field_key);
  $field = $this->field;
  $form['content'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Template'),
    '#rows' => 5,
    '#default_value' => isset($field['properties']['content']) ? $field['properties']['content'] : '',
    '#required' => TRUE,
  ];
  return $form;
}