ConfigExportForm.php 896 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

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

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

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

38 39 40
  /**
   * {@inheritdoc}
   */
41
  public function submitForm(array &$form, array &$form_state) {
42
    $form_state['redirect'] = 'admin/config/development/configuration/export-download';
43 44
  }

45
}