You are here

public function AbstractEventVariables::set in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/preprocess_event_dispatcher/src/Variables/AbstractEventVariables.php \Drupal\preprocess_event_dispatcher\Variables\AbstractEventVariables::set()

Set a variable to a given value.

Parameters

string $name: Variable name.

mixed $value: Variable value.

1 method overrides AbstractEventVariables::set()
PageEventVariables::set in modules/preprocess_event_dispatcher/src/Variables/PageEventVariables.php
Set a given page variable.

File

modules/preprocess_event_dispatcher/src/Variables/AbstractEventVariables.php, line 54

Class

AbstractEventVariables
Class AbstractEventVariables.

Namespace

Drupal\preprocess_event_dispatcher\Variables

Code

public function set(string $name, $value = NULL) : void {
  $this->variables[$name] = $value;
}