public function FasttoggleSettingsForm::buildForm in Fasttoggle 8.3
Same name and namespace in other branches
- 8.2 src/Form/FasttoggleSettingsForm.php \Drupal\fasttoggle\Form\FasttoggleSettingsForm::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
- src/
Form/ FasttoggleSettingsForm.php, line 32
Class
- FasttoggleSettingsForm
- Configure fasttoggle settings for this site.
Namespace
Drupal\fasttoggle\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('fasttoggle.settings');
$form = [];
$form['label_style'] = [
'#type' => 'radios',
'#title' => $this
->t('Label style'),
'#description' => $this
->t('Select what kind of labels you want for fasttoggle links.'),
'#options' => [
0 => $this
->t('Status (reflects the current state, e.g. "published", "active")'),
1 => $this
->t('Action (shows what happens upon a click, e.g. "unpublish", "block")'),
],
'#default_value' => $config
->get('label_style'),
];
return parent::buildForm($form, $form_state);
}