SettingsTrayFormAnnotationIsClassBlockForm.php

Same filename in other branches
  1. 8.9.x core/modules/settings_tray/tests/modules/settings_tray_test/src/Form/SettingsTrayFormAnnotationIsClassBlockForm.php
  2. 10 core/modules/settings_tray/tests/modules/settings_tray_test/src/Form/SettingsTrayFormAnnotationIsClassBlockForm.php
  3. 11.x core/modules/settings_tray/tests/modules/settings_tray_test/src/Form/SettingsTrayFormAnnotationIsClassBlockForm.php

Namespace

Drupal\settings_tray_test\Form

File

core/modules/settings_tray/tests/modules/settings_tray_test/src/Form/SettingsTrayFormAnnotationIsClassBlockForm.php

View source
<?php

namespace Drupal\settings_tray_test\Form;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginFormBase;

/**
 * @see \Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationIsClassBlock
 */
class SettingsTrayFormAnnotationIsClassBlockForm extends PluginFormBase {
    
    /**
     * The block plugin.
     *
     * @var \Drupal\Core\Block\BlockPluginInterface
     */
    protected $plugin;
    
    /**
     * {@inheritdoc}
     */
    public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
        $form = $this->plugin
            ->buildConfigurationForm($form, $form_state);
        $form['some_setting'] = [
            '#type' => 'select',
            '#title' => t('Some setting'),
            '#options' => [
                'a' => 'A',
                'b' => 'B',
            ],
            '#required' => TRUE,
        ];
        return $form;
    }
    
    /**
     * {@inheritdoc}
     */
    public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    }

}

Classes


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.