You are here

public static function FilterTestPlaceholders::renderDynamicThing in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPlaceholders.php \Drupal\filter_test\Plugin\Filter\FilterTestPlaceholders::renderDynamicThing()
  2. 9 core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPlaceholders.php \Drupal\filter_test\Plugin\Filter\FilterTestPlaceholders::renderDynamicThing()

#lazy_builder callback; builds a render array containing the dynamic thing.

Parameters

string $thing: A "thing" string.

Return value

array A renderable array.

File

core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPlaceholders.php, line 41

Class

FilterTestPlaceholders
Provides a test filter to use placeholders.

Namespace

Drupal\filter_test\Plugin\Filter

Code

public static function renderDynamicThing($thing) {
  return [
    '#markup' => new FormattableMarkup('This is a dynamic @thing.', [
      '@thing' => $thing,
    ]),
  ];
}