Dispatch
in package
This class dispatches pages to the appropriate places
Table of Contents
- OBJECT = 1
- REDIRECT = 3
- REDIRECT3 = 7
- REDIRECT7 = 9
- REHOME = 4
- REHOME8 = 11
- TEMPLATE = 2
- XREDIRECT = 5
- XREDIRECT3 = 8
- XREDIRECT7 = 10
- XREHOME = 6
- XREHOME8 = 12
- $actions : array<, array<, mixed>>
- $checks : array<, string>
- $configs : array<, mixed>
- basicSetup() : void
- Setup basic values
- check() : void
- Check if a value is appropriate for the dispatch kind
- handle() : void
- Handle dispatch of a page.
- checkObject() : void
- Check OBJECT
- checkRedirect() : void
- Check REDIRECT - internal so no http
- checkTemplate() : void
- Check TEMPLATE
- checkXRedirect() : void
- Check XREDIRECT - external so must be a url
Constants
OBJECT
public
mixed
OBJECT
= 1
REDIRECT
public
mixed
REDIRECT
= 3
REDIRECT3
public
mixed
REDIRECT3
= 7
REDIRECT7
public
mixed
REDIRECT7
= 9
REHOME
public
mixed
REHOME
= 4
REHOME8
public
mixed
REHOME8
= 11
TEMPLATE
public
mixed
TEMPLATE
= 2
XREDIRECT
public
mixed
XREDIRECT
= 5
XREDIRECT3
public
mixed
XREDIRECT3
= 8
XREDIRECT7
public
mixed
XREDIRECT7
= 10
XREHOME
public
mixed
XREHOME
= 6
XREHOME8
public
mixed
XREHOME8
= 12
Properties
$actions
private
static array<, array<, mixed>>
$actions
= [self::REDIRECT => [TRUE, [TRUE, '', FALSE, FALSE]], self::REHOME => [TRUE, [FALSE, '', FALSE, FALSE]], self::XREDIRECT => [FALSE, [TRUE, '', FALSE, FALSE]], self::XREHOME => [FALSE, [FALSE, '', FALSE, FALSE]], self::REDIRECT3 => [TRUE, [TRUE, '', FALSE, TRUE]], self::XREDIRECT3 => [FALSE, [TRUE, '', FALSE, TRUE]], self::REDIRECT7 => [TRUE, [TRUE, '', TRUE, FALSE]], self::XREDIRECT7 => [FALSE, [TRUE, '', TRUE, FALSE]], self::REHOME8 => [TRUE, [FALSE, '', TRUE, FALSE]], self::XREHOME8 => [FALSE, [FALSE, '', TRUE, FALSE]]]
Values for determining handling of above codes
$checks
private
static array<, string>
$checks
= [self::OBJECT => 'checkObject', self::TEMPLATE => 'checkTemplate', self::REDIRECT => 'checkRedirect', self::REDIRECT3 => 'checkRedirect', self::REDIRECT7 => 'checkRedirect', self::REHOME => 'checkRedirect', self::REHOME8 => 'checkRedirect', self::XREDIRECT => 'checkXRedirect', self::XREDIRECT3 => 'checkXRedirect', self::XREDIRECT7 => 'checkXRedirect', self::XREHOME => 'checkXRedirect', self::XREHOME8 => 'checkXRedirect']
$configs
private
static array<, mixed>
$configs
= ['lang', 'keywords', 'description']
Constants that might be defined in the configuration that need to be passed into twigs.
Methods
basicSetup()
Setup basic values
public
static basicSetup(Context $context, string $action) : void
Parameters
- $context : Context
- $action : string
Return values
void —check()
Check if a value is appropriate for the dispatch kind
public
static check(int $kind, string $source) : void
Parameters
- $kind : int
- $source : string
Tags
Return values
void —handle()
Handle dispatch of a page.
public
static handle(Context $context, string $action) : void
Parameters
- $context : Context
- $action : string
Tags
Return values
void —checkObject()
Check OBJECT
private
static checkObject(string $source) : void
Parameters
- $source : string
Tags
Return values
void —checkRedirect()
Check REDIRECT - internal so no http
private
static checkRedirect(string $source) : void
Parameters
- $source : string
Tags
Return values
void —checkTemplate()
Check TEMPLATE
private
static checkTemplate(string $source) : void
Parameters
- $source : string
Tags
Return values
void —checkXRedirect()
Check XREDIRECT - external so must be a url
private
static checkXRedirect(string $source) : void
Parameters
- $source : string