Get Param

Gets the param from request by given key

@param string $method
@param string $key
@param mixed $default
@return mixed
434030
protected static function getParam($method, $key, $default = NULL) {
        if ($method == 0) {  // POST Method
            if (isset($_REQUEST[$key]) && is_array($_REQUEST[$key])) {
                $param = filter_input($method, $key, FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY);
            } else {
                $param = filter_input($method, $key, FILTER_SANITIZE_STRING, FILTER_REQUIRE_SCALAR);
            }
        } else if ($method == 1) {  // GET Method
            $param = filter_input($method, $key, FILTER_SANITIZE_STRING);
        }

        return $param ? $param : $default;
    }
44955
public function input($key = null, $default = null)
    {
        return $this->getParameter($key, $this->getPayloadData($key, $default));
    }
770044
public function getParameter($key, $default_value = NULL) {
    if (isset($this->params[$key])) {
      return $this->params[$key];
    }

    $defaults = $this->sandbox()
      ->getPolicy()
      ->getParameterDefaults();

    if (isset($defaults[$key])) {
      $default_value = $defaults[$key];
    }

    // Ensure default values are recorded for use as tokens.
    $this->setParameter($key, $default_value);
    return $default_value;
  }
314882
public static function getParam($key, $defaultValue = null) {
		return ArrayHelper::getValue(Yii::$app->params, $key, $defaultValue);
	}
142333
public function get($key, $default = null)
    {
        if ($this->hasAccessibleMethod($key)) {
            return $this->$key();
        }

        if ($this->hasAccessibleProperty($key)) {
            return $this->$key;
        }

        return $default;
    }
105216
static public function get($key = null, $default = null) {
        if (is_null($key)) return json_decode(json_encode(self::$_config));
        
        $config = &self::$_config;
        
        return Utils::arrayGet($config, $key, $default);
    }
1005232
public function get($key = null, $default = null)
	{
		if ( is_null($key) )
		{
			return $this->get;
		}

		return Arr::get($this->get, $key, $default);
	}
656003
public function get($key, $default = null)
    {
        if(strpos($key, '.')) {
            return $this->getRecursive($key, $default);
        }

        if (array_key_exists($key, $this->parameters)) {
            return $this->parameters[$key];
        } else {
            return $default;
        }
    }
175186
public function getParameter($key, $default = null, $domain = null)
    {
        if ($domain) {
            return isset($this->config[$domain][$key])  ? $this->config[$domain][$key] : $default;
        }

        return isset($this->config[$key])  ? $this->config[$key] : $default;
    }
366316
public function get($property, $type = null, $default = null)
    {
        if (!isset($this->param[$property])) {
            return $default;
        }

        if (isset($type)) {
            $method = TypeCast::METHODPREFIX . $type;

            return TypeCast::$method($this->param[$property]);
        }

        return $this->param[$property];
    }
538182
public function getParam($key, $default = null)
    {
        $params = $this->params;
        if (is_array($params) && isset($params[$key])) {
            $result = $params[$key];
        } else {
            if (!is_string($default) && is_callable($default)) {
                $result = $default();
            } else {
                $result = $default;
            }
        }

        return $result;
    }
211327
public function getParam(string $key, $default = null)
    {
        if (isset($this->post[$key])) {
            return $this->post[$key];
        }
        if (isset($this->get[$key])) {
            return $this->get[$key];
        }
        return $default;
    }
810783
private function get($key, $default = null)
    {
        if (isset($this->responseData['error'][$key])) {
            return $this->responseData['error'][$key];
        }

        return $default;
    }
779022
public function & get($key = null, $default = null)
	{
		if (is_null($default) and func_num_args() === 1)
		{
			return $this->_view->get($key);
		}
		return $this->_view->get($key, $default);
	}
75957
public function getParameterType(
        ReflectionMethod $method,
        string $parameterName,
        ? string $default = null
    ) : ? string {
        $parameters = $method->getParameters();

        foreach ($parameters as $parameter) {
            if ($parameter->getName() === $parameterName) {
                $class = $parameter->getClass();

                return $class
                    ? $class->getName()
                    : $default;
            }
        }

        return $default;
    }
320480
public function getAuthCodeRequestParam($key, $default = null)
    {
        if (array_key_exists($key, $this->authCodeRequestParams)) {
            return $this->authCodeRequestParams[$key];
        }

        return $default;
    }
1102350
public function input(string $key = null, $default = null)
    {
        $inputs = $this->getQueryParams() + $this->getParsedBody();
        if (is_null($key)) {
            return $inputs;
        }
        return $inputs[$key] ?? $default;
    }