function TestingExampleController::simpletestDescription

Same name in other branches
  1. 4.0.x modules/testing_example/src/Controller/TestingExampleController.php \Drupal\testing_example\Controller\TestingExampleController::simpletestDescription()

Generate a render array for the Simpletest description.

Return value

array A render array.

1 string reference to 'TestingExampleController::simpletestDescription'
testing_example.routing.yml in modules/testing_example/testing_example.routing.yml
modules/testing_example/testing_example.routing.yml

File

modules/testing_example/src/Controller/TestingExampleController.php, line 32

Class

TestingExampleController
Controller for testing_example module.

Namespace

Drupal\testing_example\Controller

Code

public function simpletestDescription() {
    $template_file = \Drupal::service('extension.list.module')->getPath('testing_example') . '/templates/simpletest.description.html.twig';
    $build = [
        'description' => [
            '#type' => 'inline_template',
            '#template' => file_get_contents($template_file),
        ],
    ];
    return $build;
}