CodeIgniter v4.5 API

SiteURIFactory
in package

FinalYes

Creates SiteURI using superglobals.

This class also updates superglobal $_SERVER and $_GET.

Tags
see
SiteURIFactoryTest

Table of Contents

Properties

$appConfig  : App
$superglobals  : Superglobals

Methods

__construct()  : mixed
createFromGlobals()  : SiteURI
Create the current URI object from superglobals.
createURIFromRoutePath()  : SiteURI
Create current URI object.
getHost()  : string|null
getValidHost()  : string|null
parseQueryString()  : string
Will parse QUERY_STRING and automatically detect the URI from it.
parseRequestURI()  : string
Will parse the REQUEST_URI and automatically detect the URI from it, fixing the query string if necessary.

Properties

Methods

__construct()

public __construct(App $appConfig, Superglobals $superglobals) : mixed
Parameters
$appConfig : App
$superglobals : Superglobals

createFromGlobals()

Create the current URI object from superglobals.

public createFromGlobals() : SiteURI

This method updates superglobal $_SERVER and $_GET.

Return values
SiteURI

createURIFromRoutePath()

Create current URI object.

private createURIFromRoutePath(string $routePath) : SiteURI
Parameters
$routePath : string

URI path relative to baseURL

Return values
SiteURI

getHost()

private getHost() : string|null
Return values
string|null

The current hostname. Returns null if no valid host.

getValidHost()

private getValidHost(string $host) : string|null
Parameters
$host : string
Return values
string|null

The valid hostname. Returns null if not valid.

parseQueryString()

Will parse QUERY_STRING and automatically detect the URI from it.

private parseQueryString() : string

This method updates superglobal $_SERVER and $_GET.

Return values
string

The route path (before normalization).

parseRequestURI()

Will parse the REQUEST_URI and automatically detect the URI from it, fixing the query string if necessary.

private parseRequestURI() : string

This method updates superglobal $_SERVER and $_GET.

Return values
string

The route path (before normalization).


        
On this page

Search results