alert_message-1.0.x-dev/src/Form/AlertMessageSettingsForm.php

src/Form/AlertMessageSettingsForm.php
<?php

namespace Drupal\alert_message\Form;

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

/**
 * Configuration form for a alert message entity type.
 */
class AlertMessageSettingsForm extends FormBase {

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

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {

    $form['settings'] = [
      '#markup' => $this->t('Only one bundle is available for Alert message. You may want to configure the fields though.'),
    ];

    return $form;
  }

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

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc