JsErrorsTestController.php

Same filename in other branches
  1. 9 core/modules/system/tests/modules/js_errors_test/src/Controller/JsErrorsTestController.php
  2. 10 core/modules/system/tests/modules/js_errors_test/src/Controller/JsErrorsTestController.php

Namespace

Drupal\js_errors_test\Controller

File

core/modules/system/tests/modules/js_errors_test/src/Controller/JsErrorsTestController.php

View source
<?php

declare (strict_types=1);
namespace Drupal\js_errors_test\Controller;


/**
 * Test Controller loading js_errors_test/errors_test library.
 */
class JsErrorsTestController {
    
    /**
     * Renders page that has js_errors_test/errors_test library attached.
     *
     * @return string[][]
     *   Render array.
     */
    public function jsErrorsTest() : array {
        return [
            '#attached' => [
                'library' => [
                    'js_errors_test/errors_test',
                ],
            ],
        ];
    }
    
    /**
     * Renders page that has js_errors_test/errors_async_test library attached.
     *
     * @return string[][]
     *   Render array.
     */
    public function jsErrorsAsyncTest() : array {
        return [
            '#attached' => [
                'library' => [
                    'js_errors_test/errors_async_test',
                ],
            ],
        ];
    }

}

Classes

Title Deprecated Summary
JsErrorsTestController Test Controller loading js_errors_test/errors_test library.

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