public function ConfigForm::buildForm in Gin Layout Builder 8.2
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 FormInterface::buildForm
File
- src/
Form/ ConfigForm.php, line 23
Class
- ConfigForm
- Class ConfigForm.
Namespace
Drupal\wingsuit_companion\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('wingsuit_companion.config');
$form['dist_path'] = [
'#type' => 'textfield',
'#title' => $this
->t('Dist path'),
'#description' => $this
->t('A local file system path to your dist/app-drupal directory.'),
'#maxlength' => 128,
'#size' => 64,
'#default_value' => $config
->get('dist_path'),
'#weight' => '0',
];
$form['only_own_layout'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Use only Wingsuit patterns.'),
'#description' => $this
->t('Check this to hide all other layouts in layout builder.'),
'#default_value' => $config
->get('only_own_layout'),
'#weight' => '0',
];
$form['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Submit'),
];
return $form;
}