Support Joomla!

references:joomla.framework:application:japplication-setuserstate

Table of Contents

setUserState

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JApplication Method setUserState Reference setUserState() Never Work in Progress

Sets the value of a user state variable. User state variables are stored with the session and are persistent between requests.

Syntax

mixed setUserState ( $key, $value )

$key string is a string containing the path of the state variable to set.
$value string is a string containing the value of the variable to store.

Examples

If the following code is executed on a page load:

Example

global $mainframe;

$mainframe->setUserState( "$option.sampleState", "Stored value" );

then the following code:

Example

global $mainframe;

echo $mainframe->getUserState( "$option.sampleState" );

would produce

Result

Stored value

 
references/joomla.framework/application/japplication-setuserstate.txt (706 views) · Last modified: 2007/08/15 14:49