AbstractGuard

Namespace

IO\Guards

Properties
Type Name Description

string

$pluginNamespace

Methods
public assert():mixed

Returned value will be compared with asserted value to decide if it should redirect.

public assertOrRedirect($expected, $redirectUri)

Redirect to given URI if expected value equals return value of AbstractGuard::assert()

Parameters

Type

Name

Description

mixed

$expected

The value to compare with return value of AbstractGuard::asssert()

string

$redirectUri

The URI to redirect to

public static redirect($uri, $params = [])

Redirect to a given URI. Appends params as query string.

Parameters

Type

Name

Description

string

$uri

The URI to redirect to.

array

$params

A map of params to append to URI as query string.

public static getUrl($uri = null):string

Transform a given URI to an URL by prepending used protocol and server name.

Parameters

Type

Name

Description

string

$uri