class PHPUnitExampleController in Examples for Developers 8
Same name and namespace in other branches
- 3.x modules/phpunit_example/src/Controller/PHPUnitExampleController.php \Drupal\phpunit_example\Controller\PHPUnitExampleController
Controller for PHPUnit description page.
This class uses the DescriptionTemplateTrait to display text we put in the templates/description.html.twig file. We render out the text via its description() method, and set up our routing to point to PHPUnitExampleController::description().
Hierarchy
- class \Drupal\phpunit_example\Controller\PHPUnitExampleController uses DescriptionTemplateTrait
Expanded class hierarchy of PHPUnitExampleController
File
- phpunit_example/
src/ Controller/ PHPUnitExampleController.php, line 15
Namespace
Drupal\phpunit_example\ControllerView source
class PHPUnitExampleController {
use DescriptionTemplateTrait;
/**
* {@inheritdoc}
*/
protected function getModuleName() {
return 'phpunit_example';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DescriptionTemplateTrait:: |
public | function | Generate a render array with our templated content. | |
DescriptionTemplateTrait:: |
protected | function | Get full path to the template. | |
DescriptionTemplateTrait:: |
protected | function | Variables to act as context to the twig template file. | 1 |
PHPUnitExampleController:: |
protected | function |
Name of our module. Overrides DescriptionTemplateTrait:: |