Gets the submitted value or the default value if nothing submitted
@param string $fieldName The field name
@param string $defaultValue
@return string Returns the submitted value or the defaut value if form not yet triggered
198279
protected function Value($fieldName, $defaultValue) {
        $form = Form::Current();
        if (!$form) {
            return $defaultValue;
        }
        return $form->GetValue($fieldName, $defaultValue);
    }
1083296
public function getHeader(string $header, string $defaultValue = null)
    {
        $header = strtolower($header);
        if (isset($this->headers[$header])) {
            return $this->headers[$header];
        }
        return $defaultValue;
    }
665004
public function getUserOption($option, $defaultValue=null) {
    return isset($this->_options[$option])
        ? $this->_options[$option]
        : $defaultValue;
  }
484724
public function getOption($optionName, $defaultValue = null)
    {
        $option = $this->optionManager->findOneByOptionName($optionName);

        return $option ?: $defaultValue;
    }
777510
protected function getOption(string $optionName, $defaultValue = null)
    {
        return $this->getOptions()->has($optionName) ? $this->getOptions()->get($optionName) : $defaultValue;
    }
746767
public function post($key, $defaultValue = null)
    {
        $r = Request::getInstance();

        return $r->post($key, $defaultValue);
    }
1163031
public function getValueFromRequest($field, $default = false)
  {
    if (!$element = $this->field($field)) {
      return $default;
    }

    $req = $this->getRequest();
    $input_name = $element->getInputName();

    return $element instanceof Element\File
      ? $req->files->get($input_name, $default, true)
      : $req->get($input_name, $default, true);
  }
355211
protected function getSettingValue($name, $defaultValue = NULL) {
		return TRUE === isset($this->settings[$name]) ? $this->settings[$name] : $defaultValue;
	}
453774
public function getGet($name = null, $defaultValue = null) 
    {
        if ($name === null) {
            return $_GET;
        }
        return (isset($_GET[$name])) ? $_GET[$name] : $defaultValue;
    }
205914
public function getSetting( string $name, $defaultValue = null )
	{
		return $this->isSettingSet($name)
			? $this->settings[$name]
			: $defaultValue;
	}
401183
public static function getDefault($keys, $defaultValue) {
    try {
      $value = self::req($keys);
    } catch (MissingConfigVariableException $e) {
      return $defaultValue;
    }
    
    return $value;
  }
516138
public function getQueryParameter($key, $defaultValue = null)
    {
        if (array_key_exists($key, $this->getParameters)) {
            return $this->getParameters[$key];
        }

        return $defaultValue;
    }
436007
private function buildFields($defaultFieldsValue) {
        $rawFields = $this->getRequest()->get('fields', null, $defaultFieldsValue);
        $fields = explode(',', $rawFields);
        $helper = new SplitHelper('.');
        $keyedFields = array_fill_keys($fields, null);
        $this->setField(new Field($helper->convert($keyedFields)));
    }
1165367
public function getValue($defaultValue = null)
    {
        if ($this->read === false) {
            if (isset($_COOKIE[$this->name])) {
                if ($this->useEncryption === true) {
                    return $this->value = $this->decrypt($_COOKIE[$this->name]);
                }

                return $this->value = $_COOKIE[$this->name];
            }

            return $defaultValue;
        }

        return $this->value;
    }
890716
final protected function getPropertyDefaultValue(string $fieldName)
    {
        /** @var null|ReflectionProperty $property */
        $property = $this->metadata->getReflectionProperties()[$fieldName] ?? null;
        if (!$property) {
            return null;
        }

        return $property->getDeclaringClass()->getDefaultProperties()[$fieldName] ?? null;
    }
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;
    }
321291
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        /** @var string|null $guard */
        $guard = $this->directiveArgValue('guard');

        return $fieldValue->setResolver(
            function () use ($guard): ?Authenticatable {
                return $this
                    ->authFactory
                    ->guard($guard)
                    ->user();
            }
        );
    }