SampleExampleController.php

Same filename and directory in other branches
  1. 8.x-1.x tests/modules/examples_description_test/src/Controller/SampleExampleController.php
  2. 4.0.x tests/modules/examples_description_test/src/Controller/SampleExampleController.php

Namespace

Drupal\examples_description_test\Controller

File

tests/modules/examples_description_test/src/Controller/SampleExampleController.php

View source
<?php

namespace Drupal\examples_description_test\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\examples\Utility\DescriptionTemplateTrait;

/**
 * Simple controller class used to test the DescriptionTemplateTrait.
 */
class SampleExampleController extends ControllerBase {
  use DescriptionTemplateTrait;
  
  /**
   * {@inheritdoc}
   */
  protected function getModuleName() {
    return 'examples_description_test';
  }
  
  /**
   * {@inheritdoc}
   *
   * We override this so we can see some substitutions.
   */
  protected function getDescriptionVariables() {
    $variables = [
      'module' => $this->getModuleName(),
      'slogan' => $this->t('We aim to please'),
    ];
    return $variables;
  }

}

Classes

Title Deprecated Summary
SampleExampleController Simple controller class used to test the DescriptionTemplateTrait.