public function add($name, $value = null)
    {
        if (empty($name)) {
            return $this;
        }

        $params = (!is_array($name) ? array($name => $value) : $name);

        $query = $this->query(true);

        foreach ($params as $key => $val) {
            if (empty($val)) {
                unset($query[$key]);
            } elseif (!empty($val)) {
                $query[$key] = $val;
            }
        }

        $query              = http_build_query($query);
        $this->url['query'] = $query;

        return $this;
    }
public function add($name, $value = null)
    {
        if (empty($name)) {
            return $this;
        }

        $params = (!is_array($name) ? array($name => $value) : $name);

        $query = $this->query(true);

        foreach ($params as $key => $val) {
            if (empty($val)) {
                unset($query[$key]);
            } elseif (!empty($val)) {
                $query[$key] = $val;
            }
        }

        $query              = http_build_query($query);
        $this->url['query'] = $query;

        return $this;
    }
public function add ( $ name , $ value = null ) { if ( empty ( $ name ) ) { return $ this ; } $ params = ( ! is_array ( $ name ) ? array ( $ name => $ value ) : $ name ) ; $ query = $ this -> query ( true ) ; foreach ( $ params as $ key => $ val ) { if ( empty ( $ val ) ) { unset ( $ query [ $ key ] ) ; } elseif ( ! empty ( $ val ) ) { $ query [ $ key ] = $ val ; } } $ query = http_build_query ( $ query ) ; $ this -> url [ 'query' ] = $ query ; return $ this ; }
Add, replace or remove parameters from query url.

@param  mixed $name Array of parameter, or parameter name.
@param  mixed $value Null if first parameter is array, else parameter value.
@return self
Add replace or remove parameters from query url .