UserRedirector
extends Redirector
in package
Table of Contents
- $generator : UrlGenerator
- The URL generator instance.
- $macros : array<string|int, mixed>
- The registered string macros.
- $session : Store
- The session store instance.
- __call() : mixed
- Dynamically handle calls to the class.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __construct() : void
- Create a new Redirector instance.
- action() : RedirectResponse
- Create a new redirect response to a controller action.
- away() : RedirectResponse
- Create a new redirect response to an external URL (no validation).
- back() : RedirectResponse
- Create a new redirect response to the previous location.
- getUrlGenerator() : UrlGenerator
- Get the URL generator instance.
- guest() : RedirectResponse
- Create a new redirect response, while putting the current URL in the session.
- hasMacro() : bool
- Checks if macro is registered.
- home() : RedirectResponse
- Create a new redirect response to the "home" route.
- intended() : RedirectResponse
- Create a new redirect response to the previously intended location.
- macro() : void
- Register a custom macro.
- mixin() : void
- Mix another object into the class.
- refresh() : RedirectResponse
- Create a new redirect response to the current URI.
- route() : RedirectResponse
- Create a new redirect response to a named route.
- secure() : RedirectResponse
- Create a new redirect response to the given HTTPS path.
- setSession() : void
- Set the active session store.
- to() : RedirectResponse
- Create a new redirect response to the given path.
- createRedirect() : RedirectResponse
- Create a new redirect response.
Properties
$generator
The URL generator instance.
protected
UrlGenerator
$generator
$macros
The registered string macros.
protected
static array<string|int, mixed>
$macros
= []
$session
The session store instance.
protected
Store
$session
Methods
__call()
Dynamically handle calls to the class.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__callStatic()
Dynamically handle calls to the class.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__construct()
Create a new Redirector instance.
public
__construct(UrlGenerator $generator) : void
Parameters
- $generator : UrlGenerator
Return values
void —action()
Create a new redirect response to a controller action.
public
action(string $action[, array<string|int, mixed> $parameters = [] ][, int $status = 302 ][, array<string|int, mixed> $headers = [] ]) : RedirectResponse
Parameters
- $action : string
- $parameters : array<string|int, mixed> = []
- $status : int = 302
- $headers : array<string|int, mixed> = []
Return values
RedirectResponse —away()
Create a new redirect response to an external URL (no validation).
public
away(string $path[, int $status = 302 ][, array<string|int, mixed> $headers = [] ]) : RedirectResponse
Parameters
- $path : string
- $status : int = 302
- $headers : array<string|int, mixed> = []
Return values
RedirectResponse —back()
Create a new redirect response to the previous location.
public
back([int $status = 302 ][, array<string|int, mixed> $headers = [] ][, mixed $fallback = false ]) : RedirectResponse
Parameters
- $status : int = 302
- $headers : array<string|int, mixed> = []
- $fallback : mixed = false
Return values
RedirectResponse —getUrlGenerator()
Get the URL generator instance.
public
getUrlGenerator() : UrlGenerator
Return values
UrlGenerator —guest()
Create a new redirect response, while putting the current URL in the session.
public
guest(string $path[, int $status = 302 ][, array<string|int, mixed> $headers = [] ][, bool $secure = null ]) : RedirectResponse
Parameters
- $path : string
- $status : int = 302
- $headers : array<string|int, mixed> = []
- $secure : bool = null
Return values
RedirectResponse —hasMacro()
Checks if macro is registered.
public
static hasMacro(string $name) : bool
Parameters
- $name : string
Return values
bool —home()
Create a new redirect response to the "home" route.
public
home([int $status = 302 ]) : RedirectResponse
Parameters
- $status : int = 302
Return values
RedirectResponse —intended()
Create a new redirect response to the previously intended location.
public
intended([string $default = '/' ][, int $status = 302 ][, array<string|int, mixed> $headers = [] ][, bool $secure = null ]) : RedirectResponse
Parameters
- $default : string = '/'
- $status : int = 302
- $headers : array<string|int, mixed> = []
- $secure : bool = null
Return values
RedirectResponse —macro()
Register a custom macro.
public
static macro(string $name, object|callable $macro) : void
Parameters
- $name : string
- $macro : object|callable
Return values
void —mixin()
Mix another object into the class.
public
static mixin(object $mixin) : void
Parameters
- $mixin : object
Return values
void —refresh()
Create a new redirect response to the current URI.
public
refresh([int $status = 302 ][, array<string|int, mixed> $headers = [] ]) : RedirectResponse
Parameters
- $status : int = 302
- $headers : array<string|int, mixed> = []
Return values
RedirectResponse —route()
Create a new redirect response to a named route.
public
route(string $route[, array<string|int, mixed> $parameters = [] ][, int $status = 302 ][, array<string|int, mixed> $headers = [] ]) : RedirectResponse
Parameters
- $route : string
- $parameters : array<string|int, mixed> = []
- $status : int = 302
- $headers : array<string|int, mixed> = []
Return values
RedirectResponse —secure()
Create a new redirect response to the given HTTPS path.
public
secure(string $path[, int $status = 302 ][, array<string|int, mixed> $headers = [] ]) : RedirectResponse
Parameters
- $path : string
- $status : int = 302
- $headers : array<string|int, mixed> = []
Return values
RedirectResponse —setSession()
Set the active session store.
public
setSession(Store $session) : void
Parameters
- $session : Store
Return values
void —to()
Create a new redirect response to the given path.
public
to(string $path[, int $status = 302 ][, array<string|int, mixed> $headers = [] ][, bool $secure = null ]) : RedirectResponse
Parameters
- $path : string
- $status : int = 302
- $headers : array<string|int, mixed> = []
- $secure : bool = null
Return values
RedirectResponse —createRedirect()
Create a new redirect response.
protected
createRedirect(string $path, int $status, array<string|int, mixed> $headers) : RedirectResponse
Parameters
- $path : string
- $status : int
- $headers : array<string|int, mixed>