class HooksExampleController in Examples for Developers 8
Same name and namespace in other branches
- 3.x modules/hooks_example/src/Controller/HooksExampleController.php \Drupal\hooks_example\Controller\HooksExampleController
Controller for Hooks example description page.
This class uses the DescriptionTemplateTrait to display text we put in the templates/description.html.twig file.
Hierarchy
- class \Drupal\hooks_example\Controller\HooksExampleController uses DescriptionTemplateTrait
Expanded class hierarchy of HooksExampleController
File
- hooks_example/
src/ Controller/ HooksExampleController.php, line 13
Namespace
Drupal\hooks_example\ControllerView source
class HooksExampleController {
use DescriptionTemplateTrait;
/**
* {@inheritdoc}
*/
protected function getModuleName() {
return 'hooks_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 |
HooksExampleController:: |
protected | function |
Name of our module. Overrides DescriptionTemplateTrait:: |