You are here

public function AbstractEventVariables::set in Hook Event Dispatcher 8

Set a variable to a given value.

Parameters

string $name: Variable name.

mixed $value: Variable value.

Return value

$this Event variables.

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

File

src/Event/Preprocess/Variables/AbstractEventVariables.php, line 55

Class

AbstractEventVariables
Class AbstractEventVariables.

Namespace

Drupal\hook_event_dispatcher\Event\Preprocess\Variables

Code

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