You are here

public function FlagSearchApiConfigForm::buildForm in Flag Search API 8

Flag Search Api configuration form.

Overrides ConfigFormBase::buildForm

File

src/Form/FlagSearchApiConfigForm.php, line 32

Class

FlagSearchApiConfigForm
Implements a FlagSearchApiConfig form.

Namespace

Drupal\flag_search_api\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // Flag Search Api settings:
  $chosen_conf = $this->configFactory
    ->get('flag_search_api.settings');
  $form['options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Flag Search API Reindexing'),
  );
  $form['options']['reindex_on_flagging'] = array(
    '#type' => 'checkbox',
    '#title' => t('Reindex Item on Flagged action'),
    '#default_value' => $chosen_conf
      ->get('reindex_on_flagging'),
    '#description' => t('Enable or disable reindexing items on flagging action.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}