You are here

public function PageEventVariables::get in Hook Event Dispatcher 3.x

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

Get the template var.

Parameters

string $name: Name.

mixed $default: Default.

Return value

mixed Value

Overrides AbstractEventVariables::get

File

modules/preprocess_event_dispatcher/src/Variables/PageEventVariables.php, line 47

Class

PageEventVariables
Class PageEventVariables.

Namespace

Drupal\preprocess_event_dispatcher\Variables

Code

public function get(string $name, $default = NULL) {
  if (!isset($this->variables['page'][$name])) {
    return $default;
  }
  return $this->variables['page'][$name];
}