You are here

public function DemoConfigManageForm::buildForm in Demonstration site (Sandbox / Snapshot) 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 FormInterface::buildForm

File

src/Form/DemoConfigManageForm.php, line 23

Class

DemoConfigManageForm
This class returns the demo_config_manage_form in which there will be a button to create the snapshot of the configuration.

Namespace

Drupal\demo\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['actions'] = [
    '#type' => 'actions',
  ];
  $form['description'] = [
    '#type' => 'item',
    '#description' => t('This will create snapshot of the configuration of your drupal site.'),
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => t('+ Create snapshot'),
    '#attributes' => [
      'class' => [
        'btn-primary',
      ],
    ],
  ];
  return $form;
}