PHP 클래스 think\Cookie

파일 보기 프로젝트 열기: top-think/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$config
$init

공개 메소드들

메소드 설명
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 设置、获取、删除

비공개 메소드들

메소드 설명
jsonFormatProtect ( &$val, $key, $type = 'encode' )

메소드 상세

clear() 공개 정적인 메소드

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

delete() 공개 정적인 메소드

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

get() 공개 정적인 메소드

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

has() 공개 정적인 메소드

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

init() 공개 정적인 메소드

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

prefix() 공개 정적인 메소드

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

set() 공개 정적인 메소드

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

프로퍼티 상세

$config 보호되어 있는 정적으로 프로퍼티

protected static $config

$init 보호되어 있는 정적으로 프로퍼티

protected static $init