You are here

public function SubscriberSettingsForm::buildForm in Simplenews 8

Same name and namespace in other branches
  1. 8.2 src/Form/SubscriberSettingsForm.php \Drupal\simplenews\Form\SubscriberSettingsForm::buildForm()
  2. 3.x src/Form/SubscriberSettingsForm.php \Drupal\simplenews\Form\SubscriberSettingsForm::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/SubscriberSettingsForm.php, line 30

Class

SubscriberSettingsForm
Configure simplenews newsletter settings.

Namespace

Drupal\simplenews\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('simplenews.settings');
  $form['account'] = array(
    '#type' => 'fieldset',
    '#title' => $this
      ->t('User account'),
    '#collapsible' => FALSE,
  );
  $form['account']['simplenews_sync_fields'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Synchronize between account and subscriber fields'),
    '#default_value' => $config
      ->get('subscriber.sync_fields'),
    '#description' => $this
      ->t('<p>When checked fields that exist with identical name and type on subscriber and accounts will be synchronized.</p>'),
  );
  return parent::buildForm($form, $form_state);
}