HumHub Documentation (unofficial)

HTMLPurifier_Context
in package

Registry object that contains information about the current context.

Tags
warning

Is a bit buggy when variables are set to null: it thinks they don't exist! So use false instead, please.

note

Since the variables Context deals with may not be objects, references are very important here! Do not remove!

Table of Contents

Properties

$_storage  : mixed
Private array that stores the references.

Methods

destroy()  : mixed
Destroys a variable in the context.
exists()  : bool
Checks whether or not the variable exists.
get()  : mixed
Retrieves a variable reference from the context.
loadArray()  : mixed
Loads a series of variables from an associative array
register()  : mixed
Registers a variable into the context.

Properties

$_storage

Private array that stores the references.

private mixed $_storage = array()
Tags
type

array

Methods

destroy()

Destroys a variable in the context.

public destroy(string $name) : mixed
Parameters
$name : string

String name

exists()

Checks whether or not the variable exists.

public exists(string $name) : bool
Parameters
$name : string

String name

Return values
bool

get()

Retrieves a variable reference from the context.

public & get(string $name[, bool $ignore_error = false ]) : mixed
Parameters
$name : string

String name

$ignore_error : bool = false

Boolean whether or not to ignore error

loadArray()

Loads a series of variables from an associative array

public loadArray(array<string|int, mixed> $context_array) : mixed
Parameters
$context_array : array<string|int, mixed>

Assoc array of variables to load

register()

Registers a variable into the context.

public register(string $name, mixed &$ref) : mixed
Parameters
$name : string

String name

$ref : mixed

Reference to variable to be registered


        
On this page

Search results