You are here

public function CourseSettingsForm::buildForm in Course 3.x

Same name and namespace in other branches
  1. 8.3 src/Form/CourseSettingsForm.php \Drupal\course\Form\CourseSettingsForm::buildForm()
  2. 8.2 src/Form/CourseSettingsForm.php \Drupal\course\Form\CourseSettingsForm::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 ConfigFormBase::buildForm

File

src/Form/CourseSettingsForm.php, line 29

Class

CourseSettingsForm

Namespace

Drupal\course\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('course.settings');
  $form['testing'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Welcome message'),
    '#description' => $this
      ->t('Welcome message display to users when they login'),
    '#default_value' => $config
      ->get('testing'),
  ];
  return parent::buildForm($form, $form_state);
}