final class LinkGenerator

Link generator.

Properties

internal $lastRequest

Methods

__construct(Router $router, UrlScript $refUrl, IPresenterFactory|null $presenterFactory = null)

No description

string|null
link(string $destination, array $args = [], Component|null $component = null, string|null $mode = null)

Generates URL to presenter.

createRequest(Component|null $component, string $destination, array $args, string $mode)

No description

static array
parseDestination(string $destination)

Parse destination in format "[//] [[[module:]presenter:]action | signal! | this | @alias] [?query] [#fragment]"

string
requestToUrl(Request $request, bool|null $relative = false)

Converts Request to URL.

withReferenceUrl(string $url)

No description

Details

at line 26
__construct(Router $router, UrlScript $refUrl, IPresenterFactory|null $presenterFactory = null)

No description

Parameters

Router $router
UrlScript $refUrl
IPresenterFactory|null $presenterFactory

Generates URL to presenter.

Parameters

string $destination

in format "[//] [[[module:]presenter:]action | signal! | this | @alias] [#fragment]"

array $args
Component|null $component
string|null $mode

Return Value

string|null

Exceptions

InvalidLinkException

at line 62
Request createRequest(Component|null $component, string $destination, array $args, string $mode)

internal  
 

No description

Parameters

Component|null $component
string $destination

in format "[[[module:]presenter:]action | signal! | this | @alias]"

array $args
string $mode forward|redirect|link

Return Value

Request

Exceptions

InvalidLinkException

at line 238
static array parseDestination(string $destination)

internal  
 

Parse destination in format "[//] [[[module:]presenter:]action | signal! | this | @alias] [?query] [#fragment]"

Parameters

string $destination

Return Value

array

Exceptions

InvalidLinkException

at line 262
string requestToUrl(Request $request, bool|null $relative = false)

Converts Request to URL.

Parameters

Request $request
bool|null $relative

Return Value

string

at line 283
LinkGenerator withReferenceUrl(string $url)

No description

Parameters

string $url

Return Value

LinkGenerator