PHP Class s, kirby

显示文件 Open project: bastianallgeier/kirby Class Usage Examples

Public Methods

Method Description
destroy ( ) Destroys a session
get ( mixed $key = false, mixed $default = null ) : mixed Gets a session value by key
id ( ) : string Returns the current session id
remove ( mixed $key ) : array Removes a value from the session by key
restart ( ) Destroys a session first and then starts it again
set ( mixed $key, mixed $value = false ) Sets a session value by key
start ( ) Starts a new session

Method Details

destroy() static public method

Destroys a session
static public destroy ( )

get() static public method

Gets a session value by key
static public get ( mixed $key = false, mixed $default = null ) : mixed
$key mixed The key to look for. Pass false or null to return the entire session array.
$default mixed Optional default value, which should be returned if no element has been found
return mixed

id() static public method

Returns the current session id
static public id ( ) : string
return string

remove() static public method

Removes a value from the session by key
static public remove ( mixed $key ) : array
$key mixed The key to remove by
return array The session array without the value

restart() static public method

Destroys a session first and then starts it again
static public restart ( )

set() static public method

Sets a session value by key
static public set ( mixed $key, mixed $value = false )
$key mixed The key to define
$value mixed The value for the passed key

start() static public method

Starts a new session
static public start ( )