function PositionShimTestController::build

Same name in other branches
  1. 9 core/modules/system/tests/modules/position_shim_test/src/Controller/PositionShimTestController.php \Drupal\position_shim_test\Controller\PositionShimTestController::build()
  2. 11.x core/modules/system/tests/modules/position_shim_test/src/Controller/PositionShimTestController.php \Drupal\position_shim_test\Controller\PositionShimTestController::build()

Provides a page with the jQuery UI position library for testing.

Return value

array The render array.

1 string reference to 'PositionShimTestController::build'
position_shim_test.routing.yml in core/modules/system/tests/modules/position_shim_test/position_shim_test.routing.yml
core/modules/system/tests/modules/position_shim_test/position_shim_test.routing.yml

File

core/modules/system/tests/modules/position_shim_test/src/Controller/PositionShimTestController.php, line 15

Class

PositionShimTestController

Namespace

Drupal\position_shim_test\Controller

Code

public function build() {
    return [
        'reference1' => [
            '#type' => 'container',
            '#attributes' => [
                'id' => 'position-reference-1',
            ],
        ],
        '#attached' => [
            'library' => [
                'core/drupal.jquery.position',
                'position_shim_test/position.shim.test',
            ],
        ],
    ];
}

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