ViewState
A singleton class that maintains the view state in the session.
Tags
Table of Contents
- $instance : ViewState
- The view state object singleton.
- $markdownTextBoxRows : string
- The amount of rows to expand the Markdown edit TextBox by.
- $renderAdminMenu : bool
- If the backend admin menu should be displayed or not.
- $selectedStart : int
- The start position of the last pagination page by the user.
- $selectedTab : string
- The name of the last selected tab by the user.
- get() : string
- Get the attribute value indicated by the key.
- getInstance() : ViewState
- Get the ViewState instance. Loads from $_SESSION if its not already in memory, otherwise a new instance will be returned with empty properties.
- set() : mixed
- Sets the attribute value indicated by the key. The ViewState instance will be serialized and saved back to the $_SESSION.
- __construct() : mixed
- Private constructor means the class cannot be instantiated from elsewhere.
Properties
$instance
The view state object singleton.
protected
static ViewState
$instance
Tags
$markdownTextBoxRows
The amount of rows to expand the Markdown edit TextBox by.
protected
string
$markdownTextBoxRows
Tags
$renderAdminMenu
If the backend admin menu should be displayed or not.
protected
bool
$renderAdminMenu
= false
Tags
$selectedStart
The start position of the last pagination page by the user.
protected
int
$selectedStart
= 0
Tags
$selectedTab
The name of the last selected tab by the user.
protected
string
$selectedTab
Tags
Methods
get()
Get the attribute value indicated by the key.
public
get(string $key) : string
Parameters
- $key : string
Tags
Return values
string —getInstance()
Get the ViewState instance. Loads from $_SESSION if its not already in memory, otherwise a new instance will be returned with empty properties.
public
static getInstance() : ViewState
Tags
Return values
ViewState —set()
Sets the attribute value indicated by the key. The ViewState instance will be serialized and saved back to the $_SESSION.
public
set(string $key, string $value) : mixed
Parameters
- $key : string
- $value : string
Tags
Return values
mixed —__construct()
Private constructor means the class cannot be instantiated from elsewhere.
private
__construct() : mixed