function CacheTestController::urlBubbling

Same name in other branches
  1. 9 core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php \Drupal\cache_test\Controller\CacheTestController::urlBubbling()
  2. 10 core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php \Drupal\cache_test\Controller\CacheTestController::urlBubbling()
  3. 11.x core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php \Drupal\cache_test\Controller\CacheTestController::urlBubbling()

Early renders a URL to test bubbleable metadata bubbling.

1 string reference to 'CacheTestController::urlBubbling'
cache_test.routing.yml in core/modules/system/tests/modules/cache_test/cache_test.routing.yml
core/modules/system/tests/modules/cache_test/cache_test.routing.yml

File

core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php, line 15

Class

CacheTestController
Controller routines for cache_test routes.

Namespace

Drupal\cache_test\Controller

Code

public function urlBubbling() {
    $url = Url::fromRoute('<current>')->setAbsolute();
    return [
        '#markup' => 'This URL is early-rendered: ' . $url->toString() . '. Yet, its bubbleable metadata should be bubbled.',
    ];
}

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