function BubblingTest::bubblingCacheOverwritePrerender

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

#pre_render callback for testOverWriteCacheKeys().

File

core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php, line 706

Class

BubblingTest

Namespace

Drupal\Tests\Core\Render

Code

public static function bubblingCacheOverwritePrerender($elements) {
    // Overwrite the #cache entry with new data.
    $elements['#cache'] = [
        'keys' => [
            'llama',
            'foo',
        ],
    ];
    $elements['#markup'] = 'Setting cache keys just now!';
    return $elements;
}

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