You are here

public function ChoosePdfStyleForm::buildForm in 3D Flipbook 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/ChoosePdfStyleForm.php, line 57

Class

ChoosePdfStyleForm
Configure custom settings for this site.

Namespace

Drupal\flipbook\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('config.flipbook_chooseconfig');
  $form['choice'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Popup Pdf'),
    '#options' => [
      0 => 'No',
      1 => 'Yes',
    ],
    '#default_value' => !$config
      ->get('pdf.choice') ? 0 : $config
      ->get('pdf.choice'),
    '#description' => $this
      ->t('Choose if you want pop-up pdf'),
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Save'),
  ];
  return $form;
}