Documentation

Route
in package

Implements Grav Route.

Table of Contents

Properties

$extension  : string
$gravParams  : array<string|int, mixed>
$language  : string
$queryParams  : array<string|int, mixed>
$root  : string
$route  : string

Methods

__construct()  : mixed
You can use `RouteFactory` functions to create new `Route` objects.
__toString()  : string
getBase()  : string
getExtension()  : string
getGravParam()  : string|null
getGravParams()  : array<string|int, mixed>
getLanguage()  : string
getLanguagePrefix()  : string
getParam()  : string|array<string|int, mixed>|null
Return value of the parameter, looking into both Grav parameters and query parameters.
getParams()  : array<string|int, mixed>
Return array of both query and Grav parameters.
getParts()  : array<string|int, mixed>
getQueryParam()  : string|array<string|int, mixed>|null
getQueryParams()  : array<string|int, mixed>
getRootPrefix()  : string
getRoute()  : string
getRouteParts()  : array<string|int, mixed>
getUri()  : Uri
toString()  : string
withAddedPath()  : Route
withExtension()  : Route
withGravParam()  : Route
withLanguage()  : Route
withoutGravParams()  : Route
withoutParams()  : Route
withoutQueryParams()  : Route
withQueryParam()  : Route
withRoot()  : Route
Allow the ability to set the root to something else
withRoute()  : Route
Allow the ability to set the route to something else
copy()  : Route
getUriPath()  : string
getUriQuery()  : string
initParts()  : void
withParam()  : Route

Properties

$extension

private string $extension = ''

$gravParams

private array<string|int, mixed> $gravParams = []

$language

private string $language = ''

$queryParams

private array<string|int, mixed> $queryParams = []

$root

private string $root = ''

$route

private string $route = ''

Methods

__construct()

You can use `RouteFactory` functions to create new `Route` objects.

public __construct([array<string|int, mixed> $parts = [] ]) : mixed
Parameters
$parts : array<string|int, mixed> = []
Tags
throws
InvalidArgumentException

__toString()

public __toString() : string

Use ->toString(true) or ->getUri() instead.

Attributes
#[ReturnTypeWillChange]
Return values
string

getBase()

public getBase([string|null $language = null ]) : string
Parameters
$language : string|null = null
Return values
string

getExtension()

public getExtension() : string
Return values
string

getGravParam()

public getGravParam(string $param) : string|null
Parameters
$param : string
Return values
string|null

getGravParams()

public getGravParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getLanguage()

public getLanguage() : string
Return values
string

getLanguagePrefix()

public getLanguagePrefix() : string
Return values
string

getParam()

Return value of the parameter, looking into both Grav parameters and query parameters.

public getParam(string $param) : string|array<string|int, mixed>|null

If the parameter exists in both, return Grav parameter.

Parameters
$param : string
Return values
string|array<string|int, mixed>|null

getParams()

Return array of both query and Grav parameters.

public getParams() : array<string|int, mixed>

If a parameter exists in both, prefer Grav parameter.

Return values
array<string|int, mixed>

getParts()

public getParts() : array<string|int, mixed>
Return values
array<string|int, mixed>

getQueryParam()

public getQueryParam(string $param) : string|array<string|int, mixed>|null
Parameters
$param : string
Return values
string|array<string|int, mixed>|null

getQueryParams()

public getQueryParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRootPrefix()

public getRootPrefix() : string
Return values
string

getRoute()

public getRoute([int $offset = 0 ][, int|null $length = null ]) : string
Parameters
$offset : int = 0
$length : int|null = null
Return values
string

getRouteParts()

public getRouteParts([int $offset = 0 ][, int|null $length = null ]) : array<string|int, mixed>
Parameters
$offset : int = 0
$length : int|null = null
Return values
array<string|int, mixed>

toString()

public toString([bool $includeRoot = false ]) : string
Parameters
$includeRoot : bool = false
Return values
string

withAddedPath()

public withAddedPath(string $path) : Route
Parameters
$path : string
Return values
Route

withExtension()

public withExtension(string $extension) : Route
Parameters
$extension : string
Return values
Route

withGravParam()

public withGravParam(string $param, mixed $value) : Route
Parameters
$param : string
$value : mixed
Return values
Route

withLanguage()

public withLanguage(string|null $language) : Route
Parameters
$language : string|null
Return values
Route

withQueryParam()

public withQueryParam(string $param, mixed $value) : Route
Parameters
$param : string
$value : mixed
Return values
Route

withRoot()

Allow the ability to set the root to something else

public withRoot(string $root) : Route
Parameters
$root : string
Return values
Route

withRoute()

Allow the ability to set the route to something else

public withRoute(string $route) : Route
Parameters
$route : string
Return values
Route

getUriPath()

protected getUriPath([bool $includeRoot = false ]) : string
Parameters
$includeRoot : bool = false
Return values
string

getUriQuery()

protected getUriQuery() : string
Return values
string

initParts()

protected initParts(array<string|int, mixed> $parts) : void
Parameters
$parts : array<string|int, mixed>

withParam()

protected withParam(string $type, string $param, mixed $value) : Route
Parameters
$type : string
$param : string
$value : mixed
Return values
Route

        
On this page

Search results