\TbTags

## TbTags class

Encapsulates the Bootstrap Tags plugin by Maxwells

Summary

Methods
Properties
Constants
init()
run()
renderContent()
registerClientScript()
$form
$suggestions
$events
$restrictTo
$tagData
$popoverData
$exclude
$displayPopovers
$tagClass
$promptText
No constants found
No protected methods found
$options
N/A
No private methods found
No private properties found
N/A

Properties

$form

$form : \TbActiveForm

Type

\TbActiveForm — when created via TbActiveForm This attribute is set to the form that renders the widget

$suggestions

$suggestions : array

Type

array — Suggestions for generating the list options: array('A','B','C')

$events

$events : string[]

Type

string[] — the JavaScript event handlers. The events are on the format: <pre> // ... 'whenAddingTag' => 'js:function(tag){ console.log(tag);}', // ... </pre>

$restrictTo

$restrictTo : array

Type

array — the list of allowed tags

$tagData

$tagData : array

Type

array — list of tags to display initially display

$popoverData

$popoverData : array

Type

array — list of popover messages that should be displayed with the tags initially displayed. <strong>Note</strong>: Is important that the list matches the index list of those tags in $tagData.

$exclude

$exclude : array

Type

array — the list of disallowed tags

$displayPopovers

$displayPopovers : boolean

Type

boolean — whether to display popovers with information or not

$tagClass

$tagClass : string

Type

string — what class the tag div will have for styling. Defaults to `btn-success`

$promptText

$promptText : string

Type

string — placeholder string when the re are no tags and nothing typed in

$options

$options : array

Type

array — the array to configure the js component.

Methods

init()

init()

### .init()

Initializes the widget.

run()

run()

### .run()

Runs the widget.

renderContent()

renderContent(integer $id, string $name) : string

### .renderContent()

Renders required HTML tags

Parameters

integer $id
string $name

Returns

string —

with HTML tags

registerClientScript()

registerClientScript(string $id)

### .registerClientScript()

Registers required client script for bootstrap select2. It is not used through bootstrap->registerPlugin in order to attach events if any

Parameters

string $id