Get param value by name

@param string $paramName
@param mixed $default
@return mized
490349
public function get($paramName = null, $default = null)
    {
        $result = $default;

        $params = $this->getRequestParams();

        if ($paramName === null) {
            $result = $params;
        } elseif (isset($params[$paramName])) {
            $result = $params[$paramName];
        }

        return $result;
    }
235951
public function getParameterValue(string $parameterName)
    {
        if (!$this->hasParameterValue($parameterName)) {
            return null;
        }

        return $this->parameterValues[$parameterName];
    }
436094
public function getFormDefinedUrl($parameterName, $default = null)
    {
        $formDefinedUrl = $this->form->get($parameterName)->getData();

        if (empty($formDefinedUrl)) {
            if ($default === null) {
                $default = ConfigQuery::read('base_url', '/');
            }

            $formDefinedUrl = $default;
        }

        return URL::getInstance()->absoluteUrl($formDefinedUrl);
    }
1245274
protected function getRequestParamValue(string $defaultValue = null, string $defaultName = 'id'): ?string
    {
        $paramName = $this->getRequestParamName($defaultName);

        return $this->request->get($paramName, $defaultValue);
    }
485651
public function input($name=null, $default=null)
    {
        if (!$name) {
            return $this->getRequestParams();
        } else {
            $method = $name2 = null;
            $name = str_replace('.', ':', $name);
            if (($pos = strpos($name, ':')) !== false) {
                $names = explode(':', $name);
                $method = strtoupper(trim($names[0]));
                if (in_array($method, ['GET', 'POST', 'OPTION', 'DELETE', 'PUT'])) {
                    $name = trim($names[1]);
                    if (isset($names[2])) {
                        $name2 = trim($names[2]);
                    }
                } else {
                    $method = null;
                    $name = trim($names[0]);
                    $name2 = trim($names[1]);
                }
            } elseif (strtoupper($name) == 'GET' || strtoupper($name) == 'POST') {
                $method = strtoupper($name);
                $name = null;
            }
            
            if ($name === '*') {
                $name = null;
            }
            
            switch ($method) {
                case 'GET':
                    if ($name2) {
                        return isset($this->getQueryParam()[$name][$name2]) ? $this->getQueryParam()[$name][$name2] : $default;
                    } else {
                        return $name ? $this->getQueryParam($name, $default) : $this->getQueryParams();
                    }
                    break;
                case 'POST':
                    if ($name2) {
                        return isset($this->getPostParams()[$name][$name2]) ? $this->getPostParams()[$name][$name2] : $default;
                    } else {
                        return $name ? (isset($this->getPostParams()[$name]) ? $this->getPostParams()[$name] : $default) : $this->getPostParams();
                    }
                    break;
                default:
                    if ($name2) {
                        return isset($this->getRequestParams()[$name][$name2]) ? $this->getRequestParams()[$name][$name2] : $default;
                    } else {
                        return $name ? (isset($this->getRequestParams()[$name]) ? $this->getRequestParams()[$name] : $default) : $this->getRequestParams();
                    }
                    break;
            }
        }
    }
74626
public function getParam(string $paramName)
	{
		return $this->hasParam($paramName) ? $this->params[ $paramName ] : null;
	}
1158320
private function getParameterFromContext(array $context, string $parameterName, $default = null)
    {
        $filters = $context['filters'] ?? [];

        return \array_key_exists($parameterName, $filters) ? $filters[$parameterName] : $default;
    }
1006920
public function get(string $name, $default = null)
    {
        return $this->has($name) ? $this->values[$name] : $default;
    }
960999
protected function getRawParameter($paramName)
    {
        $raw = $this->getRequest()->getRawParameters();
        if (!isset($raw[$paramName])) {
            throw new \common_exception_MissingParameter($paramName);
        }
        return $raw[$paramName];
    }
584471
public String getParamString(String paramName) {
        Object paramValue = getParam(paramName);
        if (paramValue == null) {
            return null;
        }
        return paramValue.toString();
    }
948670
public function param($name, $default = null)
    {
        if(!$this->params)
            $this->params = $this->getMethod() == 'GET' ? $this->getQueryParams() : array_merge($this->getQueryParams(), $this->getParsedBody());

        return array_key_exists($name, $this->params) ? $this->params[$name] : $default;
    }
658522
public function get(string $name, $default = null)
    {
        $parts = explode('[', $name);
        $lastKey = trim(array_pop($parts), ']');
        $current = &$this->parameters;
        foreach ($parts as $part) {
            $target = trim($part, ']');
            if (!is_array($current) || !array_key_exists($target, $current)) {
                return $default;
            }

            $current = &$current[$target];
        }

        if (!array_key_exists($lastKey, $current)) {
            return $default;
        }

        return $current[$lastKey];
    }
411010
public function getActionParam($name, $default = null)
    {
        $params = $this->getActionParams();
        return isset($params[$name]) ? $params[$name] : $default;
    }
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;
    }
505850
private function getParameterValue(array $parameter, $name, $default = null)
    {
        if (!array_key_exists($name, $parameter)) {
            return $default;
        }

        return $parameter[$name]->getValue();
    }
921389
public function get($key, $default = null, $params = [])
    {
        $params = array_merge($this->_defaults, $params);

        foreach ($params['objects'] as $object) {
            if ($object && ($object instanceof ViewableData) && $object->$key) {
                return $object->$key;
            }
        }

        // Grab mapping from object
        $mapping = (array)Config::inst()->get('environment', 'mapping');
        $objects = array_reverse($params['objects'], true);

        foreach ($objects as $object) {
            if ($object && method_exists($object, 'config')) {
                $mapping = array_merge($mapping, (array)$object->config()->db_to_environment_mapping);
            }
        }

        $mapping = array_merge($mapping, $params['mapping']);

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

        // 1. Check cache for valid key and return if found
        if ($params['fromCache'] && array_key_exists($key, $this->_cache)) {
            return $this->_cache[$key] === null ? $default : $this->_cache[$key];
        }

        $value = $default;

        // The function to check the $_ENV vars
        $findInEnvironment = function ($key) use ($params) {
            $value = null;

            if (isset($_ENV[$key])) {
                $value = $_ENV[$key];
            }

            if (getenv($key)) {
                $value = getenv($key);
            }

            if (is_callable($params['parseEnvVarFn'])) {
                $value = call_user_func_array($params['parseEnvVarFn'], [$value, $key]);
            }

            return $value;
        };

        // If key has dots, check recursively
        if (strpos($key, '.')) {
            $keyParts = explode('.', $key);

            // First part of key can denote multiple classes separated by a pipe (or)
            $namespaces = explode('|', array_shift($keyParts));

            // 2. Check \Config class for original value
            foreach ($namespaces as $namespace) {
                // Do a callback to get a value from a function sent in (this is for checking SiteConfig)
                if (isset($params['beforeConfigNamespaceCheckCallbacks'][$namespace]) && is_callable($params['beforeConfigNamespaceCheckCallbacks'][$namespace])) {
                    $value = call_user_func_array($params['beforeConfigNamespaceCheckCallbacks'][$namespace],
                        [$keyParts, $key]);

                    if ($value !== null) {
                        break;
                    }
                }

                $config = Config::inst()->forClass($namespace);

                $value = $config->get(implode('.', $keyParts), $params['on']);

                // 3. If value not found explicitly, recursively get if array
                if (!$value && count($keyParts) > 1) {
                    $configKey = array_shift($keyParts);
                    $configValue = $config->get($configKey, $params['on']);

                    if (is_array($configValue)) {
                        $value = array_get($configValue, implode('.', $keyParts));
                    } else {
                        $value = $configValue;
                    }
                }

                if ($value !== null) {
                    break;
                }
            }

            // 4. Check environment for key explicitly
            if ($value === null) {
                $value = $findInEnvironment($key);
            }

            // 5. Otherwise check for key by namespace in environment
            if ($value === null && count($namespaces) > 1) {
                foreach ($namespaces as $namespace) {
                    $value = $findInEnvironment($namespace . '.' . implode('.', $keyParts));

                    if ($value !== null) {
                        break;
                    }
                }
            }

            // 6. Otherwise check for key recursively in environment
            if ($value === null && !empty($keyParts)) {
                foreach ($namespaces as $namespace) {
                    if (($first = $findInEnvironment($namespace)) && is_array($first)) {
                        $value = array_get($first, implode('.', $keyParts));

                        if ($value !== null) {
                            break;
                        }
                    }
                }

                // 7. Otherwise, check for key as is (without namespaces, a global override to assume)
                if ($value === null) {
                    $value = $findInEnvironment(implode('.', $keyParts));
                }
            }
        } else {
            // Or else check in $_ENV vars
            $value = $findInEnvironment($key);
        }

        if ($params['doCache']) {
            $this->_cache[$key] = $value;
        }

        return $value === null ? $default : $value;
    }
976055
public static function getArray(
        array $params,
        string $key,
        $default = null
    ) {
        if (self::has($params, $key)) {
            return (array)$params[$key];
        }

        return $default;
    }