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

CTX_ERROR

CTX_ERROR

CTX_ERROR_CLASS

CTX_ERROR_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

$alerts

$alerts : array

Type

array — The configuration for individual types of alerts. Here's the allowed array elements: 'visible' (= null) If set to false, this type of alerts will not be rendered. 'fade' (= widget value) The same as a global fade property. If set, alert will close itself fading away. It defaults to the widget-level fade property value. 'htmlOptions' (= array()) Attributes for the individual alert panels. Widget-level htmlOptions was for wrapper element around them. Note that the class attribute will be appended with classes required for alert to be Twitter Bootstrap alert. 'closeText' (= widget value) The same as a global closeText property. If set to false, close button will be removed from this type of alert. It defaults to the widget-level closeText property value.

$closeText

$closeText : string|boolean

Type

string|boolean — What to render as a button to close the alert panel. Default is to render a diagonal cross symbol. If set to false, no close button will be rendered, making user unable to close the alert.

$fade

$fade : boolean

Type

boolean — When set, alert will fade out using transitions when closed. Defaults to 'true'

$events

$events : string[]

Type

string[] — The Javascript event handlers attached to all alert elements being rendered. It should be an array with elements being a javascript string containing event handler function definition (along with declaration) and indexed with the names of events. This will be fed to jQuery.on verbatim.

$htmlOptions

$htmlOptions : array

Type

array — Traditional property to set attributes to the element wrapping all of alerts.

$userComponentId

$userComponentId : string

Type

string — Name of the component which will be used to get alert messages. It should implement getFlash() method which returns alert message by its type. Default is 'user'.

$_containerId

$_containerId

Methods

init()

init()

### .init()

Initializes the widget.

run()

run()

### .run()

Runs the widget.

addCssClass()

addCssClass(array $htmlOptions, string $class)

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

Parameters

array $htmlOptions
string $class

isValidContext()

isValidContext( $context)

only these are allowed for alerts

Parameters

$context

getContextClass()

getContextClass(string $context)

Parameters

string $context

renderSingleAlert()

renderSingleAlert(mixed $alert,  $context, mixed $alertText)

Parameters

mixed $alert
$context
mixed $alertText