You are here

class HooksExampleController in Examples for Developers 8

Same name and namespace in other branches
  1. 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

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

Namesort descending Modifiers Type Description 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