You are here

MediaGallerySettingsForm.php in Media Gallery 8

File

src/Form/MediaGallerySettingsForm.php
View source
<?php

namespace Drupal\media_gallery\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Configuration form for a media gallery entity type.
 */
class MediaGallerySettingsForm extends FormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'media_gallery_settings';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['settings'] = [
      '#markup' => $this
        ->t('Settings form for a media gallery entity type.'),
    ];
    $form['actions'] = [
      '#type' => 'actions',
    ];
    $form['actions']['submit'] = [
      '#type' => 'submit',
      '#value' => $this
        ->t('Save'),
    ];
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this
      ->messenger()
      ->addStatus($this
      ->t('The configuration has been updated.'));
  }

}

Classes

Namesort descending Description
MediaGallerySettingsForm Configuration form for a media gallery entity type.