function BigPipeTestController::helloOrHi

Same name in other branches
  1. 10 core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php \Drupal\big_pipe_test\BigPipeTestController::helloOrHi()

#lazy_builder callback; says "hello" or "hi".

Return value

array

File

core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php, line 163

Class

BigPipeTestController
Returns responses for Big Pipe routes.

Namespace

Drupal\big_pipe_test

Code

public static function helloOrHi() {
    return [
        '#markup' => BigPipeMarkup::create('<marquee>llamas forever!</marquee>'),
        '#cache' => [
            'max-age' => 0,
            'tags' => [
                'cache_tag_set_in_lazy_builder',
            ],
        ],
    ];
}

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