function BigPipeTestController::placeholderPreview

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

A page with placeholder preview.

Return value

array[]

1 string reference to 'BigPipeTestController::placeholderPreview'
big_pipe_test.routing.yml in core/modules/big_pipe/tests/modules/big_pipe_test/big_pipe_test.routing.yml
core/modules/big_pipe/tests/modules/big_pipe_test/big_pipe_test.routing.yml

File

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

Class

BigPipeTestController
Returns responses for Big Pipe routes.

Namespace

Drupal\big_pipe_test

Code

public function placeholderPreview() {
    return [
        'user_container' => [
            '#type' => 'container',
            '#attributes' => [
                'id' => 'placeholder-preview-twig-container',
            ],
            'user' => [
                '#lazy_builder' => [
                    'user.toolbar_link_builder:renderDisplayName',
                    [],
                ],
                '#create_placeholder' => TRUE,
            ],
        ],
        'user_links_container' => [
            '#type' => 'container',
            '#attributes' => [
                'id' => 'placeholder-render-array-container',
            ],
            'user_links' => [
                '#lazy_builder' => [
                    static::class . '::helloOrHi',
                    [],
                ],
                '#create_placeholder' => TRUE,
                '#lazy_builder_preview' => [
                    '#attributes' => [
                        'id' => 'render-array-preview',
                    ],
                    '#type' => 'container',
                    '#markup' => 'There is a lamb and there is a puppy',
                ],
            ],
        ],
    ];
}

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