PlayerPage
extends Page
in package
A container that holds data needed to create a new page.
Table of Contents
Properties
- $allowAjax : bool
- Used to allow a page to be processed from an AJAX call.
- $file : string
- Template file associated with page (for display pages only).
- $skipRedirect : bool
- Used to skip redirect hooks at the beginning of page processing.
- $underAttack : bool
- Storage to remember if we need to display the Under Attack message.
Methods
- build() : void
- getLandingPage() : self
- Returns the default display page when in or out of a game.
- go() : never
- Forward to the page identified by this container.
- href() : string
- Create an HREF (based on a random SN) to link to this page.
- isLinkReusable() : bool
- Defines if the page is is always available, or if it is invalid after one use (i.e. if you get a back button error when navigating back to it).
- process() : void
- Process this page by executing the associated file.
- showUnderAttack() : bool
- Determine if we should show the player that they are under attack, since it needs to persist across ajax updates.
Properties
$allowAjax
Used to allow a page to be processed from an AJAX call.
public
bool
$allowAjax
= false
$file
Template file associated with page (for display pages only).
public
string
$file
= ''
$skipRedirect
Used to skip redirect hooks at the beginning of page processing.
public
bool
$skipRedirect
= false
$underAttack
Storage to remember if we need to display the Under Attack message.
protected
bool
$underAttack
= false
Methods
build()
public
abstract build(AbstractPlayer $player, Template $template) : void
Parameters
- $player : AbstractPlayer
- $template : Template
getLandingPage()
Returns the default display page when in or out of a game.
public
static getLandingPage([string|null $msg = null ]) : self
Parameters
- $msg : string|null = null
Return values
selfgo()
Forward to the page identified by this container.
public
go() : never
Return values
neverhref()
Create an HREF (based on a random SN) to link to this page.
public
href([bool $forceFullURL = false ]) : string
The container is saved in the Smr\Session under this SN so that on the next request, we can grab the container out of the Smr\Session.
Parameters
- $forceFullURL : bool = false
Return values
stringisLinkReusable()
Defines if the page is is always available, or if it is invalid after one use (i.e. if you get a back button error when navigating back to it).
public
isLinkReusable() : bool
Only relevant to pages stored as links in the session.
Return values
boolprocess()
Process this page by executing the associated file.
public
process() : void
showUnderAttack()
Determine if we should show the player that they are under attack, since it needs to persist across ajax updates.
public
showUnderAttack(AbstractPlayer $player, bool $ajax) : bool
Parameters
- $player : AbstractPlayer
- $ajax : bool