You are here

public function TestingExampleController::simpletestDescription in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 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_get_path('module', 'testing_example') . '/templates/simpletest.description.html.twig';
  $build = [
    'description' => [
      '#type' => 'inline_template',
      '#template' => file_get_contents($template_file),
    ],
  ];
  return $build;
}