PHP Class think\Cookie

Mostra file Open project: top-think/framework Class Usage Examples

Protected Properties

Property Type Description
$config
$init

Public Methods

Method Description
clear ( string | null $prefix = null ) : mixed Cookie清空
delete ( string $name, string | null $prefix = null ) : mixed Cookie删除
get ( string $name, string | null $prefix = null ) : mixed Cookie获取
has ( string $name, string | null $prefix = null ) : boolean 判断Cookie数据
init ( array $config = [] ) : void Cookie初始化
prefix ( string $prefix = '' ) : string | void 设置或者获取cookie作用域(前缀)
set ( string $name, mixed $value = '', mixed $option = null ) : mixed Cookie 设置、获取、删除

Private Methods

Method Description
jsonFormatProtect ( &$val, $key, $type = 'encode' )

Method Details

clear() public static method

Cookie清空
public static clear ( string | null $prefix = null ) : mixed
$prefix string | null cookie前缀
return mixed

delete() public static method

Cookie删除
public static delete ( string $name, string | null $prefix = null ) : mixed
$name string cookie名称
$prefix string | null cookie前缀
return mixed

get() public static method

Cookie获取
public static get ( string $name, string | null $prefix = null ) : mixed
$name string cookie名称
$prefix string | null cookie前缀
return mixed

has() public static method

判断Cookie数据
public static has ( string $name, string | null $prefix = null ) : boolean
$name string cookie名称
$prefix string | null cookie前缀
return boolean

init() public static method

Cookie初始化
public static init ( array $config = [] ) : void
$config array
return void

prefix() public static method

设置或者获取cookie作用域(前缀)
public static prefix ( string $prefix = '' ) : string | void
$prefix string
return string | void

set() public static method

Cookie 设置、获取、删除
public static set ( string $name, mixed $value = '', mixed $option = null ) : mixed
$name string cookie名称
$value mixed cookie值
$option mixed 可选参数 可能会是 null|integer|string
return mixed

Property Details

$config protected_oe static_oe property

protected static $config

$init protected_oe static_oe property

protected static $init