You are here

protected function DescriptionTemplateTrait::getDescriptionVariables in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x src/Utility/DescriptionTemplateTrait.php \Drupal\examples\Utility\DescriptionTemplateTrait::getDescriptionVariables()

Variables to act as context to the twig template file.

Return value

array Associative array that defines context for a template.

1 call to DescriptionTemplateTrait::getDescriptionVariables()
DescriptionTemplateTrait::description in src/Utility/DescriptionTemplateTrait.php
Generate a render array with our templated content.
1 method overrides DescriptionTemplateTrait::getDescriptionVariables()
SampleExampleController::getDescriptionVariables in tests/modules/examples_description_test/src/Controller/SampleExampleController.php
We override this so we can see some substitutions.

File

src/Utility/DescriptionTemplateTrait.php, line 61

Class

DescriptionTemplateTrait
Trait to implement a "drop-in" template for Example's controllers.

Namespace

Drupal\examples\Utility

Code

protected function getDescriptionVariables() {
  $variables = [
    'module' => $this
      ->getModuleName(),
  ];
  return $variables;
}