Constants

CTX_DEFAULT

CTX_DEFAULT

CTX_PRIMARY

CTX_PRIMARY

CTX_SUCCESS

CTX_SUCCESS

CTX_INFO

CTX_INFO

CTX_WARNING

CTX_WARNING

CTX_DANGER

CTX_DANGER

CTX_DEFAULT_CLASS

CTX_DEFAULT_CLASS

CTX_PRIMARY_CLASS

CTX_PRIMARY_CLASS

CTX_SUCCESS_CLASS

CTX_SUCCESS_CLASS

CTX_INFO_CLASS

CTX_INFO_CLASS

CTX_WARNING_CLASS

CTX_WARNING_CLASS

CTX_DANGER_CLASS

CTX_DANGER_CLASS

Properties

$context

$context : string

easily make a widget more meaningful to a particular context by adding any of the contextual state classes

Type

string

$label

$label : string

Type

string — the label text.

$encodeLabel

$encodeLabel : boolean

Type

boolean — whether to encode the label.

$htmlOptions

$htmlOptions : array

Type

array — the HTML attributes for the widget container.

Methods

init()

init()

### .init()

At the start of widget we collect the attributes for badge tag.

run()

run()

### .run()

Upon completing the badge we write the span tag with collected attributes to document.

addCssClass()

addCssClass(array $htmlOptions, string $class)

Utility function for appending class names for a generic $htmlOptions array.

Parameters

array $htmlOptions
string $class

isValidContext()

isValidContext( $cotext)

Parameters

$cotext

getContextClass()

getContextClass(string $context)

Parameters

string $context