You are here

public function BuildHooksGithubConfigForm::buildForm in Build Hooks 3.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 ConfigFormBase::buildForm

File

modules/build_hooks_github/src/Form/BuildHooksGithubConfigForm.php, line 32

Class

BuildHooksGithubConfigForm
Defines a config form for Github deployments.

Namespace

Drupal\build_hooks_github\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('build_hooks_github.settings');
  $form['github_access_token'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Personal access token'),
    '#description' => $this
      ->t('Insert here your personal access token to access the Github API. You can create your token in the "Developer Settings" section of your account.'),
    '#maxlength' => 64,
    '#size' => 64,
    '#default_value' => $config
      ->get('github_access_token'),
  ];
  return parent::buildForm($form, $form_state);
}