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
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
$page
protected
HydePage
$page
Methods
__construct()
public
__construct(HydePage $page) : mixed
Parameters
- $page : HydePage
__toString()
Cast a route object into a string that can be used in a href attribute.
public
__toString() : string
Return values
stringarraySerialize()
Recursively serialize Arrayables
public
arraySerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>getLink()
Generate a link to the route destination, relative to the current route, and supports pretty URLs.
public
getLink() : string
Return values
stringgetOutputPath()
public
getOutputPath() : string
Return values
stringgetPage()
public
getPage() : HydePage
Return values
HydePagegetPageClass()
public
getPageClass() : HydePage>
Return values
HydePage>getPageIdentifier()
public
getPageIdentifier() : string
Return values
stringgetRouteKey()
public
getRouteKey() : string
Return values
stringgetSourcePath()
public
getSourcePath() : string
Return values
stringis()
Determine if the route instance matches another route or route key.
public
is(Route|RouteKey|string $route) : bool
Parameters
Return values
booljsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Tags
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
stringautomaticallySerialize()
Automatically serialize all public properties.
protected
automaticallySerialize() : array<string|int, mixed>