public function addParam($name, $value, $convertToArrayIfExists = false)
    {
        if (isset($this->components[self::QUERY][$name])) {
            if (!is_array($this->components[self::QUERY][$name])) {
                if ($convertToArrayIfExists) {
                    $this->components[self::QUERY][$name] = [$this->components[self::QUERY][$name]];
                } else {
                    throw new \InvalidArgumentException("$name is not an array");
                }
            }
        } else {
            $this->components[self::QUERY][$name] = [];
        }
        $this->components[self::QUERY][$name][] = $value;
        return $this;
    }
public function addParam($name, $value, $convertToArrayIfExists = false)
    {
        if (isset($this->components[self::QUERY][$name])) {
            if (!is_array($this->components[self::QUERY][$name])) {
                if ($convertToArrayIfExists) {
                    $this->components[self::QUERY][$name] = [$this->components[self::QUERY][$name]];
                } else {
                    throw new \InvalidArgumentException("$name is not an array");
                }
            }
        } else {
            $this->components[self::QUERY][$name] = [];
        }
        $this->components[self::QUERY][$name][] = $value;
        return $this;
    }
public function addParam ( $ name , $ value , $ convertToArrayIfExists = false ) { if ( isset ( $ this -> components [ self :: QUERY ] [ $ name ] ) ) { if ( ! is_array ( $ this -> components [ self :: QUERY ] [ $ name ] ) ) { if ( $ convertToArrayIfExists ) { $ this -> components [ self :: QUERY ] [ $ name ] = [ $ this -> components [ self :: QUERY ] [ $ name ] ] ; } else { throw new \ InvalidArgumentException ( "$name is not an array" ) ; } } } else { $ this -> components [ self :: QUERY ] [ $ name ] = [ ] ; } $ this -> components [ self :: QUERY ] [ $ name ] [ ] = $ value ; return $ this ; }
Adds a parameter at the specified path.

@param string|array $name
@param mixed $value
@param bool $convertToArrayIfExists
@return Url
@throws \InvalidArgumentException
Adds a parameter at the specified path .