You are here

public function ConfigForm::buildForm in YAML editor 8

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

File

src/Form/ConfigForm.php, line 39
Contains Drupal\yaml_editor\Form\ConfigForm.

Class

ConfigForm
Class ConfigForm.

Namespace

Drupal\yaml_editor\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('yaml_editor.config');
  $form['editor_source'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Editor source'),
    '#description' => $this
      ->t('Enter path to Ace editor.'),
    '#default_value' => $config
      ->get('editor_source'),
  ];
  return parent::buildForm($form, $form_state);
}