function ThemeTestController::testTemplate

Same name in other branches
  1. 9 core/modules/system/tests/modules/theme_test/src/ThemeTestController.php \Drupal\theme_test\ThemeTestController::testTemplate()
  2. 10 core/modules/system/tests/modules/theme_test/src/ThemeTestController.php \Drupal\theme_test\ThemeTestController::testTemplate()
  3. 11.x core/modules/system/tests/modules/theme_test/src/ThemeTestController.php \Drupal\theme_test\ThemeTestController::testTemplate()

Tests template overriding based on filename.

Return value

array A render array containing a theme override.

1 string reference to 'ThemeTestController::testTemplate'
theme_test.routing.yml in core/modules/system/tests/modules/theme_test/theme_test.routing.yml
core/modules/system/tests/modules/theme_test/theme_test.routing.yml

File

core/modules/system/tests/modules/theme_test/src/ThemeTestController.php, line 35

Class

ThemeTestController
Controller routines for theme test routes.

Namespace

Drupal\theme_test

Code

public function testTemplate() {
    return [
        '#markup' => \Drupal::theme()->render('theme_test_template_test', []),
    ];
}

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