public function SettingsForm::buildForm in Build Hooks 3.x
Same name in this branch
- 3.x src/Form/SettingsForm.php \Drupal\build_hooks\Form\SettingsForm::buildForm()
- 3.x modules/build_hooks_bitbucket/src/Form/SettingsForm.php \Drupal\build_hooks_bitbucket\Form\SettingsForm::buildForm()
Same name and namespace in other branches
- 8.2 modules/build_hooks_bitbucket/src/Form/SettingsForm.php \Drupal\build_hooks_bitbucket\Form\SettingsForm::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_bitbucket/ src/ Form/ SettingsForm.php, line 47
Class
- SettingsForm
- Configure build_hooks_bitbucket settings for this site.
Namespace
Drupal\build_hooks_bitbucket\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('build_hooks_bitbucket.settings');
$form['username'] = [
'#type' => 'textfield',
'#title' => $this
->t('Username'),
'#default_value' => $config
->get('username'),
];
$form['password'] = [
'#type' => 'password',
'#title' => $this
->t('App Password'),
];
if (!empty($config
->get('password'))) {
$form['password']['#description'] = $this
->t('Password set. Leave blank to keep current password.');
}
return parent::buildForm($form, $form_state);
}