FOFPlatformInterface::getUserStateFromRequest
This method will try retrieving a variable from the request (input) data.
If it doesn't exist it will be loaded from the user state, typically stored in the session. If it doesn't exist there either, the $default value will be used. If $setUserState is set to true, the retrieved variable will be stored in the user session.
Signature
public function getUserStateFromRequest(string
$key,
[string
$request = null,
[FOFInput
$input = null,
[mixed
$default = null,
[string
$type = 'none',
[boolean
$setUserState = true]]]]] )
Parameters
-
$key
- The user state key for the variable
-
$request
- The request variable name for the variable
-
$input
- The FOFInput object with the request (input) data
-
$default
- The default value. Default: null
-
$type
- The filter type for the variable data. Default: none (no filtering)
-
$setUserState
- Should I set the user state with the fetched value?
Returns
- mixed
- The value of the variable