You are here

public function CamiSettingsForm::buildForm in Custom Active Menu Item 8

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/CamiSettingsForm.php, line 31

Class

CamiSettingsForm
Configure cami settings.

Namespace

Drupal\cami\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('cami.settings');
  $form['li_classes'] = array(
    '#type' => 'textfield',
    '#title' => t('List classes'),
    '#description' => t('Classes applied to <strong>li</strong> element (separate classes with spaces)'),
    '#default_value' => $config
      ->get('li_classes'),
  );
  $form['a_classes'] = array(
    '#type' => 'textfield',
    '#title' => t('Link classes'),
    '#description' => t('Classes applied to <strong>a</strong> element (separate classes with spaces)'),
    '#default_value' => $config
      ->get('a_classes'),
  );
  return parent::buildForm($form, $form_state);
}