Gets a single template variable, by its name, or
$defaultValue if the variable does not exist

@param  string $variableName
@param  mixed  $defaultValue
@return mixed
332724
public function getVariable($variableName, $defaultValue = null)
    {
        return isset($this->variables[$variableName]) ?
            $this->variables[$variableName] : $defaultValue;
    }
1216474
public function get($varname, $default = null)
    {
        return $this->_getExists($this->_vars, $varname, $value)
            ? $value
            : $default;
    }
1043056
public function getParameter($key, $defaultValue = null)
    {
        if (array_key_exists($key, $this->postParameters)) {
            return $this->postParameters[$key];
        }

        if (array_key_exists($key, $this->getParameters)) {
            return $this->getParameters[$key];
        }

        return $defaultValue;
    }
859227
public function getHeader($key, $defaultValue = null) {
		if (!is_string($key) || $key === '') {
			return $defaultValue;
		}

		$key = strtoupper(str_replace('-', '_', $key));

		return $_SERVER['HTTP_' . $key] ?? $_SERVER[$key] ?? $defaultValue;
	}
198279
protected function Value($fieldName, $defaultValue) {
        $form = Form::Current();
        if (!$form) {
            return $defaultValue;
        }
        return $form->GetValue($fieldName, $defaultValue);
    }
862214
public function get($index, $defaultValue = null)
    {
        if (isset($this->{$index})) {
            return $this->{$index};
        }

        $config = $this;
        $keys = explode('.', $index);

        while (!empty($keys)) {
            $key = array_shift($keys);

            if (!isset($config->{$key})) {
                break;
            }

            if (empty($keys)) {
                return $config->{$key};
            }

            $config = $config->{$key};

            if (empty($config)) {
                break;
            }
        }

        return $defaultValue;
    }
1308108
public static Object getVariableEL(PageContext pc, String var, Object defaultValue) {
	StringList list = parse(pc, new ParserString(var), false);
	if (list == null) return defaultValue;

	int scope = scopeString2Int(pc.ignoreScopes(), list.next());
	Object coll = null;
	if (scope == Scope.SCOPE_UNDEFINED) {
	    coll = pc.undefinedScope().get(KeyImpl.init(list.current()), NullSupportHelper.NULL());
	    if (coll == NullSupportHelper.NULL()) return defaultValue;
	}
	else {
	    try {
		coll = VariableInterpreter.scope(pc, scope, list.hasNext());
		// coll=pc.scope(scope);
	    }
	    catch (PageException e) {
		return defaultValue;
	    }
	}

	while (list.hasNext()) {
	    coll = pc.getVariableUtil().get(pc, coll, KeyImpl.init(list.next()), NullSupportHelper.NULL());
	    if (coll == NullSupportHelper.NULL()) return defaultValue;
	}
	return coll;
    }
640595
final public function getOriginalValue(string $fieldName, $defaultValue = '')
    {
        if (! is_array($this->originalValues) || ! array_key_exists($fieldName, $this->originalValues)) {
            return $defaultValue;
        }
        return $this->originalValues[$fieldName];
    }
1326467
protected function getContextVariable($variableName)
    {
        $value = null;

        $view = $this->viewHelperVariableContainer->getView();
        if ($view instanceof FusionAwareViewInterface) {
            $fusionObject = $view->getFusionObject();
            $currentContext = $fusionObject->getRuntime()->getCurrentContext();
            if (isset($currentContext[$variableName])) {
                $value = $currentContext[$variableName];
            }
        }

        return $value;
    }
455180
public function getRequestParameter($name, $defaultValue = null)
    {
        if (isset($_POST[$name])) {
            $value = $_POST[$name];
        } elseif (isset($_GET[$name])) {
            $value = $_GET[$name];
        } else {
            $value = $defaultValue;
        }

        return $value;
    }
953332
public static function get(string $filename, string $defaultValue = ''): string
    {
        if (!self::exist($filename)) {
            return $defaultValue;
        }
        return file_get_contents($filename);
    }
331083
public function getSetting($key, $defaultValue = null)
    {
        return $this->hasSetting($key) ? $this->settings[$key] : $defaultValue;
    }
401183
public static function getDefault($keys, $defaultValue) {
    try {
      $value = self::req($keys);
    } catch (MissingConfigVariableException $e) {
      return $defaultValue;
    }
    
    return $value;
  }
292141
protected function getDefaultValueAccessor($modelVariable, $property, $value)
    {
        if (Helpers::isNewerThanOrEqualTo('5.5')) {
            $template = sprintf('optional($%s)->%s', $modelVariable, $property);

            if (is_null($value) || in_array($value, ['null', '[]'])) {
                return $template;
            }

            return $template . ' ?: ' . $value;
        }

        return sprintf("isset(\$%s->%s) ? \$%s->%s : %s", $modelVariable, $property, $modelVariable, $property, $value);
    }
880935
public function getHeaderValue($name, $defaultValue = null)
    {
        $header = $this->getHeader($name);
        if ($header !== null) {
            return $header->getValue();
        }
        return $defaultValue;
    }
432212
public static function get(string $name, $defaultValue = null, string $namespace = '*')
    {
        self::initialize();
        if (self::has($name, $namespace)) {
            return $_SESSION[$namespace][$name];
        }
        return $defaultValue;
    }
560377
public function getAttr(array $name, array &$context, $defaultValue = null)
    {
        $current = array_shift($name);

        if (!array_key_exists($current, $context)) {
            return $defaultValue;
        }

        return count($name)
            ? $this->getAttr($name, $context[$current], $defaultValue)
            : $context[$current];
    }