You are here

public function SettingsForm::buildForm in Simple Meta 8

Same name and namespace in other branches
  1. 8.2 src/Form/SettingsForm.php \Drupal\simplemeta\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

src/Form/SettingsForm.php, line 36

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\simplemeta\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('simplemeta.settings');
  $form['form_enable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Add Meta Tags Form'),
    '#description' => t('If enabled, form will appear on pages'),
    '#default_value' => $config
      ->get('form_enable'),
    '#return_value' => TRUE,
  );
  return parent::buildForm($form, $form_state);
}