You are here

TestFormBlock.php in Drupal 10

File

core/modules/block/tests/modules/block_test/src/Plugin/Block/TestFormBlock.php
View source
<?php

namespace Drupal\block_test\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Provides a block to test caching.
 *
 * @Block(
 *   id = "test_form_in_block",
 *   admin_label = @Translation("Test form block caching")
 * )
 */
class TestFormBlock extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    return \Drupal::formBuilder()
      ->getForm('Drupal\\block_test\\Form\\TestForm');
  }

}

Classes

Namesort descending Description
TestFormBlock Provides a block to test caching.