function RecursivePlaceholdersTest::callback

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RecursivePlaceholdersTest::callback()
  2. 10 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RecursivePlaceholdersTest::callback()
  3. 11.x core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RecursivePlaceholdersTest::callback()

#lazy_builder callback; bubbles another placeholder.

Parameters

string $animal: An animal.

Return value

array A renderable array.

File

core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php, line 1174

Class

RecursivePlaceholdersTest

Namespace

Drupal\Tests\Core\Render

Code

public static function callback($animal) {
    return [
        'another' => [
            '#create_placeholder' => TRUE,
            '#lazy_builder' => [
                'Drupal\\Tests\\Core\\Render\\PlaceholdersTest::callback',
                [
                    $animal,
                ],
            ],
        ],
    ];
}

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