You are here

public function SettingsForm::buildForm in Easy Social 8.3

Same name and namespace in other branches
  1. 8.4 contrib/easy_social_example/src/Form/SettingsForm.php \Drupal\easy_social_example\SettingsForm::buildForm()

Implements \Drupal\Core\Form\FormInterface::buildForm().

Overrides ConfigFormBase::buildForm

File

contrib/easy_social_example/src/Form/SettingsForm.php, line 74
Contains \Drupal\easy_social_example\SettingsForm.

Class

SettingsForm
Configure user settings for this site.

Namespace

Drupal\easy_social_example

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->get('easy_social.example');
  $form['help'] = array(
    '#markup' => t('For more information, please check out the official @example share widget <a href="@url" target="_blank">documentation</a>', array(
      '@example' => t('Example'),
      '@url' => '#',
    )),
    '#weight' => -99,
  );
  $form['size'] = array(
    '#type' => 'checkbox',
    '#title' => t('Large button'),
    '#default_value' => $config
      ->get('size'),
  );
  $form['foo'] = array(
    '#type' => 'textfield',
    '#title' => t('Foo'),
    '#default_value' => $config
      ->get('foo'),
  );
  $form['baz'] = array(
    '#type' => 'checkbox',
    '#title' => t('Baz'),
    '#default_value' => $config
      ->get('baz'),
  );
  return parent::buildForm($form, $form_state);
}