public function BuildHooksNetlifyConfigForm::buildForm in Build Hooks 3.x
Same name and namespace in other branches
- 8.2 modules/build_hooks_netlify/src/Form/BuildHooksNetlifyConfigForm.php \Drupal\build_hooks_netlify\Form\BuildHooksNetlifyConfigForm::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_netlify/ src/ Form/ BuildHooksNetlifyConfigForm.php, line 32
Class
- BuildHooksNetlifyConfigForm
- Defines a config form for netlify deployments.
Namespace
Drupal\build_hooks_netlify\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('build_hooks_netlify.settings');
$form['netlify_api_key'] = [
'#type' => 'textfield',
'#title' => $this
->t('Personal access token'),
'#description' => $this
->t('Insert here your personal access token to access the Netlify API. You can create your token in the "Oauth applications" section of your netlify profile.'),
'#maxlength' => 64,
'#size' => 64,
'#default_value' => $config
->get('netlify_api_key'),
];
return parent::buildForm($form, $form_state);
}