Uri
in package
HTTP server request URI class
Tags
Table of Contents
- $basePath : string
- Base path
- $requestUri : string
- Request URI
- $segments : array<string|int, mixed>
- Path segments
- __construct() : mixed
- Constructor
- getBasePath() : string
- Get the base path
- getFullRequestUri() : string
- Get the full request URI, including base path
- getRequestUri() : string
- Get the request URI
- getSegment() : 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
- getSegments() : array<string|int, mixed>
- Get all path segments
- setBasePath() : Uri
- Set the base path
- setRequestUri() : Uri
- Set the request URI
Properties
$basePath
Base path
protected
string
$basePath
= null
$requestUri
Request URI
protected
string
$requestUri
= null
$segments
Path segments
protected
array<string|int, mixed>
$segments
= []
Methods
__construct()
Constructor
public
__construct([string $uri = null ][, string $basePath = null ]) : mixed
Instantiate the request URI object
Parameters
- $uri : string = null
- $basePath : string = null
Return values
mixed —getBasePath()
Get the base path
public
getBasePath() : string
Return values
string —getFullRequestUri()
Get the full request URI, including base path
public
getFullRequestUri() : string
Return values
string —getRequestUri()
Get the request URI
public
getRequestUri() : string
Return values
string —getSegment()
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
public
getSegment(int $i) : string
Parameters
- $i : int
Return values
string —getSegments()
Get all path segments
public
getSegments() : array<string|int, mixed>
Return values
array<string|int, mixed> —setBasePath()
Set the base path
public
setBasePath([string $path = null ]) : Uri
Parameters
- $path : string = null
Return values
Uri —setRequestUri()
Set the request URI
public
setRequestUri([string $uri = null ][, string $basePath = null ]) : Uri
Parameters
- $uri : string = null
- $basePath : string = null