wok/uri

v1.2.5 2017-03-07 09:36 UTC

This package is auto-updated.

Last update: 2024-04-25 05:48:20 UTC


README

This library is a URI manager interface.

SensioLabsInsight

Diclaimer : This component is part of the WOK (Web Operational Kit) framework. It however can be used as a standalone library.

Install

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

Usage

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.

Methods and components

Tip:

  • Methods prefixed with getX return the value or associated object
  • Methods prefixed with setX override the current value or associated object
  • Methods prefixed with withX clone the current Uri object with the new value.

String values

  • getScheme()

  • setScheme($scheme)

  • withScheme(scheme)

  • getFragment()

  • setFragment($fragment)

  • withFragment(fragment)

Host component

  • getHost()
  • setHost($host)
  • withHost($host)

Path component

  • getPath()
  • setPath($path)
  • withPath($path)

Query component

  • getQuery()
  • setQuery($query)
  • withQuery($query)

User component

  • getUser()
  • setUser($user)
  • withUser($user)