class TestContextAwareUnsatisfiedBlock

Same name in other branches
  1. 9 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareUnsatisfiedBlock.php \Drupal\block_test\Plugin\Block\TestContextAwareUnsatisfiedBlock
  2. 10 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareUnsatisfiedBlock.php \Drupal\block_test\Plugin\Block\TestContextAwareUnsatisfiedBlock
  3. 11.x core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareUnsatisfiedBlock.php \Drupal\block_test\Plugin\Block\TestContextAwareUnsatisfiedBlock

Provides a context-aware block.

Plugin annotation


@Block(
  id = "test_context_aware_unsatisfied",
  admin_label = @Translation("Test context-aware unsatisfied block"),
  context_definitions = {
    "user" = @ContextDefinition("entity:foobar")
  }
)

Hierarchy

Expanded class hierarchy of TestContextAwareUnsatisfiedBlock

File

core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareUnsatisfiedBlock.php, line 18

Namespace

Drupal\block_test\Plugin\Block
View source
class TestContextAwareUnsatisfiedBlock extends BlockBase {
    
    /**
     * {@inheritdoc}
     */
    public function build() {
        return [
            '#markup' => 'test',
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary
TestContextAwareUnsatisfiedBlock::build public function

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