PHP Class TbTags

Author: Antonio Ramirez ([email protected])
Inheritance: extends CInputWidget
Show file Open project: yinhe/yincart

Public Properties

Property Type Description
$displayPopovers boolean whether to display popovers with information or not
$events the JavaScript event handlers. The events are on the format:
...
   'whenAddingTag' => 'js:function(tag){ console.log(tag);}',
...
$exclude array
$form when created via TbActiveForm This attribute is set to the form that renders the widget
$popoverData list of popover messages that should be displayed with the tags initially displayed. Note: Is important that the list matches the index list of those tags in $tagData.
$promptText string placeholder string when the re are no tags and nothing typed in
$restrictTo array
$suggestions array Suggestions for generating the list options: array('A','B','C')
$tagClass string what class the tag div will have for styling. Defaults to btn-success
$tagData list of tags to display initially display

Protected Properties

Property Type Description
$options array the array to configure the js component.

Public Methods

Method Description
init ( ) ### .init()
registerClientScript ( string $id ) ### .registerClientScript()
renderContent ( integer $id, string $name ) : string ### .renderContent()
run ( ) ### .run()

Method Details

init() public method

Initializes the widget.
public init ( )

registerClientScript() public method

Registers required client script for bootstrap select2. It is not used through bootstrap->registerPlugin in order to attach events if any
public registerClientScript ( string $id )
$id string

renderContent() public method

Renders required HTML tags
public renderContent ( integer $id, string $name ) : string
$id integer
$name string
return string with HTML tags

run() public method

Runs the widget.
public run ( )

Property Details

$displayPopovers public property

whether to display popovers with information or not
public bool $displayPopovers
return boolean

$events public property

the JavaScript event handlers. The events are on the format:
...
   'whenAddingTag' => 'js:function(tag){ console.log(tag);}',
...
See also:
public $events

$exclude public property

public array $exclude
return array

$form public property

when created via TbActiveForm This attribute is set to the form that renders the widget
public $form

$options protected property

the array to configure the js component.
protected array $options
return array

$popoverData public property

list of popover messages that should be displayed with the tags initially displayed. Note: Is important that the list matches the index list of those tags in $tagData.
public $popoverData

$promptText public property

placeholder string when the re are no tags and nothing typed in
public string $promptText
return string

$restrictTo public property

public array $restrictTo
return array

$suggestions public property

Suggestions for generating the list options: array('A','B','C')
public array $suggestions
return array

$tagClass public property

what class the tag div will have for styling. Defaults to btn-success
public string $tagClass
return string

$tagData public property

list of tags to display initially display
public $tagData