API Documentation

Route
in package
implements Stringable, SerializableContract uses Serializable

The Route class bridges the gaps between Hyde pages and their respective compiled static webpages by providing helper methods and information allowing you to easily access and interact with the various paths associated with a page, both source and compiled file paths as well as the URL.

If you visualize a web of this class's properties, you should be able to see how this class links them all together, and what powerful information you can gain from it.

Table of Contents

Interfaces

Stringable
SerializableContract
Specifies that a class can be serialized to an array and/or JSON.

Properties

$page  : HydePage

Methods

__construct()  : mixed
__toString()  : string
Cast a route object into a string that can be used in a href attribute.
arraySerialize()  : array<string|int, mixed>
Recursively serialize Arrayables
getLink()  : string
Generate a link to the route destination, relative to the current route, and supports pretty URLs.
getOutputPath()  : string
getPage()  : HydePage
getPageClass()  : HydePage>
getPageIdentifier()  : string
getRouteKey()  : string
getSourcePath()  : string
is()  : bool
Determine if the route instance matches another route or route key.
jsonSerialize()  : array<string|int, mixed>
toArray()  : array{routeKey: string, sourcePath: string, outputPath: string, page: array{class: string, identifier: string}}
Get the instance as an array.
toJson()  : string
automaticallySerialize()  : array<string|int, mixed>
Automatically serialize all public properties.

Properties

Methods

__toString()

Cast a route object into a string that can be used in a href attribute.

public __toString() : string
Return values
string

arraySerialize()

Recursively serialize Arrayables

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

Generate a link to the route destination, relative to the current route, and supports pretty URLs.

public getLink() : string
Return values
string

getOutputPath()

public getOutputPath() : string
Return values
string

getPageClass()

public getPageClass() : HydePage>
Return values
HydePage>

getPageIdentifier()

public getPageIdentifier() : string
Return values
string

getRouteKey()

public getRouteKey() : string
Return values
string

getSourcePath()

public getSourcePath() : string
Return values
string

is()

Determine if the route instance matches another route or route key.

public is(Route|RouteKey|string $route) : bool
Parameters
$route : Route|RouteKey|string
Return values
bool

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

toArray()

Get the instance as an array.

public toArray() : array{routeKey: string, sourcePath: string, outputPath: string, page: array{class: string, identifier: string}}
Return values
array{routeKey: string, sourcePath: string, outputPath: string, page: array{class: string, identifier: string}}

toJson()

public toJson([int $options = 0 ]) : string
Parameters
$options : int = 0
Return values
string

automaticallySerialize()

Automatically serialize all public properties.

protected automaticallySerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results