ConfigExportForm.php 929 Bytes
Newer Older
1 2
<?php

3 4 5 6 7
/**
 * @file
 * Contains \Drupal\config\Form\ConfigExportForm.
 */

8 9
namespace Drupal\config\Form;

10
use Drupal\Core\Form\FormBase;
11
use Drupal\Core\Form\FormStateInterface;
12

13 14 15
/**
 * Defines the configuration export form.
 */
16
class ConfigExportForm extends FormBase {
17

18 19 20
  /**
   * {@inheritdoc}
   */
21
  public function getFormId() {
22 23 24
    return 'config_export_form';
  }

25 26 27
  /**
   * {@inheritdoc}
   */
28
  public function buildForm(array $form, FormStateInterface $form_state) {
29
    $form['description'] = array(
30
      '#markup' => '<p>' . $this->t('Use the export button below to download your site configuration.') . '</p>',
31 32 33
    );
    $form['submit'] = array(
      '#type' => 'submit',
34
      '#value' => $this->t('Export'),
35 36 37 38
    );
    return $form;
  }

39 40 41
  /**
   * {@inheritdoc}
   */
42
  public function submitForm(array &$form, FormStateInterface $form_state) {
43
    $form_state->setRedirect('config.export_download');
44 45
  }

46
}