URL::path()

Returns the URL path data.

URL::path(array $lot = []): ?string;

This method returns the URL path data. The parameter added when you get the path data is used to modify each segment of the path.

Example

$url = new URL('http://127.0.0.1/foo/bar/baz');

test($url->path); // Returns `'/foo/bar/baz'`
test($url->path()); // Returns `'/foo/bar/baz'`
test($url->path([1 => 'asdf'])); // Returns `'/foo/asdf/baz'`

URL::current()

Returns the full URL address along with its query and hash.

URL::path()

Returns the URL path data.