This library is a URI manager interface.
Diclaimer : This component is part of the WOK (Web Operational Kit) framework. It however can be used as a standalone library.
It is recommanded to install that component as a dependency using Composer :
composer require wok/uri
You're also free to get it with git or by direct download while this package has no dependencies.
git clone https://github.com/web-operational-kit/uri.git
use \WOK\Uri\Uri
// First instanciate a URI object
$uri = Uri::createFromString('http://domain.tld/path/to/resource?param=abc');
// Then you can either retrieve informations ...
$uri->getScheme();
// ... or update them
Checkout the full methods and components list as API.
Tip:
- Methods prefixed with
get
X return the value or associated object - Methods prefixed with
set
X override the current value or associated object - Methods prefixed with
with
X clone the current Uri object with the new value.
-
getScheme()
-
setScheme($scheme)
-
withScheme(scheme)
-
getFragment()
-
setFragment($fragment)
-
withFragment(fragment)
getHost()
setHost($host)
withHost($host)
getPath()
setPath($path)
withPath($path)
getQuery()
setQuery($query)
withQuery($query)
getUser()
setUser($user)
withUser($user)