You are here

final class TemplatePreprocessDefaultVariablesAlterEvent in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/core_event_dispatcher/src/Event/Theme/TemplatePreprocessDefaultVariablesAlterEvent.php \Drupal\core_event_dispatcher\Event\Theme\TemplatePreprocessDefaultVariablesAlterEvent

Class TemplatePreprocessDefaultVariablesAlterEvent.

Hierarchy

Expanded class hierarchy of TemplatePreprocessDefaultVariablesAlterEvent

2 files declare their use of TemplatePreprocessDefaultVariablesAlterEvent
core_event_dispatcher.module in modules/core_event_dispatcher/core_event_dispatcher.module
Core event dispatcher submodule.
TemplatePreprocessDefaultVariablesAlterEventTest.php in modules/core_event_dispatcher/tests/src/Unit/Theme/TemplatePreprocessDefaultVariablesAlterEventTest.php

File

modules/core_event_dispatcher/src/Event/Theme/TemplatePreprocessDefaultVariablesAlterEvent.php, line 12

Namespace

Drupal\core_event_dispatcher\Event\Theme
View source
final class TemplatePreprocessDefaultVariablesAlterEvent extends Event implements EventInterface {

  /**
   * Default template variables.
   *
   * @var array
   */
  private $variables;

  /**
   * TemplatePreprocessDefaultVariablesAlterEvent constructor.
   *
   * @param array $variables
   *   The associative array of default template variables, as set up by
   *   _template_preprocess_default_variables(). Passed by reference.
   *
   * @see hook_template_preprocess_default_variables_alter()
   */
  public function __construct(array &$variables) {
    $this->variables =& $variables;
  }

  /**
   * Get the dispatcher type.
   *
   * @return string
   *   The dispatcher type.
   */
  public function getDispatcherType() : string {
    return HookEventDispatcherInterface::TEMPLATE_PREPROCESS_DEFAULT_VARIABLES_ALTER;
  }

  /**
   * Get the default template variables by reference.
   *
   * @return array
   *   The associative array of default template variables, as set up by
   *   _template_preprocess_default_variables(). Passed by reference.
   */
  public function &getVariables() : array {
    return $this->variables;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TemplatePreprocessDefaultVariablesAlterEvent::$variables private property Default template variables.
TemplatePreprocessDefaultVariablesAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
TemplatePreprocessDefaultVariablesAlterEvent::getVariables public function Get the default template variables by reference.
TemplatePreprocessDefaultVariablesAlterEvent::__construct public function TemplatePreprocessDefaultVariablesAlterEvent constructor.