You are here

public function BuildHooksCircleCiConfigForm::buildForm in Build Hooks 3.x

Same name and namespace in other branches
  1. 8.2 modules/build_hooks_circleci/src/Form/BuildHooksCircleCiConfigForm.php \Drupal\build_hooks_circleci\Form\BuildHooksCircleCiConfigForm::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

modules/build_hooks_circleci/src/Form/BuildHooksCircleCiConfigForm.php, line 32

Class

BuildHooksCircleCiConfigForm
Defines a config form for Circle CI.

Namespace

Drupal\build_hooks_circleci\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('build_hooks_circleci.settings');
  $form['circleci_api_key'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('CircleCi api key'),
    '#description' => $this
      ->t('Insert here the api key for Circle CI'),
    '#maxlength' => 64,
    '#size' => 64,
    '#default_value' => $config
      ->get('circleci_api_key'),
  ];
  return parent::buildForm($form, $form_state);
}