\Pop\Http\Server\RequestUri

HTTP server request URI class

Summary

Methods
Properties
Constants
__construct()
getBasePath()
getRequestUri()
getFullRequestUri()
getSegment()
getSegments()
setBasePath()
setRequestUri()
No public properties found
No constants found
No protected methods found
$requestUri
$segments
$basePath
N/A
No private methods found
No private properties found
N/A

Properties

$requestUri

$requestUri : string

Request URI

Type

string

$segments

$segments : array

Path segments

Type

array

$basePath

$basePath : string

Base path

Type

string

Methods

__construct()

__construct(string  $uri = null, string  $basePath = null) 

Constructor

Instantiate the request URI object

Parameters

string $uri
string $basePath

getBasePath()

getBasePath() : string

Get the base path

Returns

string

getRequestUri()

getRequestUri() : string

Get the request URI

Returns

string

getFullRequestUri()

getFullRequestUri() : string

Get the full request URI, including base path

Returns

string

getSegment()

getSegment(integer  $i) : string

Get a path segment, divided by the forward slash, where $i refers to the array key index, i.e., 0 1 2 /hello/world/page

Parameters

integer $i

Returns

string

getSegments()

getSegments() : array

Get all path segments

Returns

array

setBasePath()

setBasePath(string  $path = null) : \Pop\Http\Server\Request\Uri

Set the base path

Parameters

string $path

Returns

\Pop\Http\Server\Request\Uri

setRequestUri()

setRequestUri(string  $uri = null, string  $basePath = null) : \Pop\Http\Server\Request\Uri

Set the request URI

Parameters

string $uri
string $basePath

Returns

\Pop\Http\Server\Request\Uri