PHP Class Prado\Web\UI\TSessionPageStatePersister

TSessionPageStatePersister implements a page state persistent method based on sessions. Page state are stored in user sessions and therefore, this persister requires session to be started and available. TSessionPageStatePersister keeps limited number of history states in session, mainly to preserve the precious server storage. The number is specified by {@link setHistorySize HistorySize}, which defaults to 10. There are a couple of ways to use TSessionPageStatePersister. One can override the page's {@link TPage::getStatePersister()} method and create a TSessionPageStatePersister instance there. Or one can configure the pages to use TSessionPageStatePersister in page configurations as follows, The above configuration will affect the pages under the directory containing this configuration and all its subdirectories. To configure individual pages to use TSessionPageStatePersister, use
Since: 3.1
Author: Qiang Xue ([email protected])
Inheritance: extends Prado\TComponent, implements Prado\Web\UI\IPageStatePersister
显示文件 Open project: pradosoft/prado

Public Methods

Method Description
getHistorySize ( ) : integer
getPage ( )
load ( ) : mixed Loads page state from session.
save ( $state ) Saves state in session.
setHistorySize ( $value )
setPage ( TPage $page )

Method Details

getHistorySize() public method

public getHistorySize ( ) : integer
return integer maximum number of page states that should be kept in session. Defaults to 10.

getPage() public method

public getPage ( )

load() public method

Loads page state from session.
public load ( ) : mixed
return mixed the restored state

save() public method

Saves state in session.
public save ( $state )

setHistorySize() public method

public setHistorySize ( $value )

setPage() public method

public setPage ( TPage $page )
$page TPage