SampleExampleController.php

Same filename in other branches
  1. 3.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.