Skip to content

Suggestion: add human readable toString method #52

Description

@8ctopus

When the url contains unicode, toString(), returns an url encoded string which is not human readable

$reference = Url::parse("https://test.com");
$url = $reference->resolve('/デジカ/');

echo $url->toString(); // https://test.com/%E3%83%87%E3%82%B8%E3%82%AB/

I suggest to add a new method toPrettyString() which simply returns the url decoded string.

    public function toPrettyString(): string
    {
        return urldecode($this->url);
    }
https://test.com/デジカ/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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