| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JApplication |
getUserState |
getUserState() |
Never | Work in Progress |
Gets the value of the user state variable. User state variables are stored with the session and are persistent between requests.
mixed getUserState ( $key )
| $key | string | is a string containing the path of the state. |
If the following code was executed on a previous page load:
Example
global $mainframe; $mainframe->setUserState( "$option.sampleState", "Stored value" );
then the following code:
Example
global $mainframe; echo $mainframe->getUserState( "$option.sampleState" );
will produce
Result
Stored value