class HooksExampleController

Same name in other branches
  1. 3.x modules/hooks_example/src/Controller/HooksExampleController.php \Drupal\hooks_example\Controller\HooksExampleController
  2. 4.0.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

Expanded class hierarchy of HooksExampleController

File

hooks_example/src/Controller/HooksExampleController.php, line 13

Namespace

Drupal\hooks_example\Controller
View source
class HooksExampleController {
    use DescriptionTemplateTrait;
    
    /**
     * {@inheritdoc}
     */
    protected function getModuleName() {
        return 'hooks_example';
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DescriptionTemplateTrait::description public function Generate a render array with our templated content.
DescriptionTemplateTrait::getDescriptionTemplatePath protected function Get full path to the template.
DescriptionTemplateTrait::getDescriptionVariables protected function Variables to act as context to the twig template file. 1
HooksExampleController::getModuleName protected function Name of our module. Overrides DescriptionTemplateTrait::getModuleName