URL::current()
Returns the full URL address along with its query and hash.
Table of Contents
Description
URL::current(array|bool|string $query = [], bool|string $hash = true): string;This method returns the full URL address along with its query and hash.
Example
$url = new URL('http://127.0.0.1/foo/bar/baz?foo=bar#baz');
echo $url->current; // Returns `'http://127.0.0.1/foo/bar/baz?foo=bar#baz'`
echo $url->current(false, false); // Returns `'http://127.0.0.1/foo/bar/baz'`
echo $url->current(true, false); // Returns `'http://127.0.0.1/foo/bar/baz?foo=bar'`
echo $url->current(false, true); // Returns `'http://127.0.0.1/foo/bar/baz#baz'`
echo $url->current([], false); // Returns `'http://127.0.0.1/foo/bar/baz?foo=bar'`
echo $url->current(['bar' => 'baz', 'foo' => 1], 'qux'); // Returns `'http://127.0.0.1/foo/bar/baz?bar=baz&foo=1#qux'`URL::_()
The dynamic method initiator.
URL::__call()
Proxy for missing methods.
URL::__callStatic()
Proxy for missing static methods.
URL::__construct()
The constructor.
URL::__get()
Proxy for missing properties.
URL::__isset()
Checks if a method returns non-null value.
URL::__serialize()
Provides data to be serialized.
URL::__set()
Sets a URL data via property access.
URL::__toString()
Proxy for the current object, casted as a string.
URL::__unserialize()
Converts the serialized data back to its object.
URL::__unset()
Deletes a URL data via property access.
URL::count()
Counts the number of URL data.
URL::current()
Returns the full URL address along with its query and hash.
URL::getIterator()
The external iterator receiver.
URL::jsonSerialize()
Returns the URL data to be serialized as JSON.
URL::offsetExists()
Checks if URL data exists.
URL::offsetGet()
Returns the normalized URL data.
URL::offsetSet()
Sets a URL data.
URL::offsetUnset()
Deletes a URL data.
URL::path()
Returns the URL path data.
URL::query()
Returns the URL query data.