Skip to content

Add the queryParam() method #27

@windbridges

Description

@windbridges

It is often necessary to update just one parameter in a query, for example:

        $url = new Url($link);
        $params = $url->queryArray();
        $params['foo'] = 'bar';
        $url->queryArray($params);

It would be great to do this in one call:

        $url = new Url($link);
        $url->queryParam('foo', 'bar');

And also the getter:

        $url = new Url($link);
        $url->queryParam('foo', 'bar');

And also for removal:

        $url = new Url($link);
        $url->queryParam('foo', null);
        // or
        $url->removeQueryParam('foo');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions