PHP Trait yii\bootstrap\BootstrapWidgetTrait

Note: class, which uses this trait must declare public field named options with the array default value: php class MyWidget extends \yii\base\Widget { use BootstrapWidgetTrait; public $options = []; } This field is not present in the trait in order to avoid possible PHP Fatal error on definition conflict.
Since: 2.0.6
Author: Antonio Ramirez ([email protected])
Author: Qiang Xue ([email protected])
Author: Paul Klimov ([email protected])
Show file Open project: yiisoft/yii2-bootstrap

Public Properties

Property Type Description
$clientEvents the event handlers for the underlying Bootstrap JS plugin. Please refer to the corresponding Bootstrap plugin Web page for possible events. For example, this page shows how to use the "Modal" plugin and the supported events (e.g. "shown").
$clientOptions the options for the underlying Bootstrap JS plugin. Please refer to the corresponding Bootstrap plugin Web page for possible options. For example, this page shows how to use the "Modal" plugin and the supported options (e.g. "remote").

Public Methods

Method Description
getView ( ) : View
init ( ) Initializes the widget.

Protected Methods

Method Description
registerClientEvents ( ) Registers JS event handlers that are listed in [[clientEvents]].
registerPlugin ( string $name ) Registers a specific Bootstrap plugin and the related events

Method Details

getView() abstract public method

See also: yii\base\Widget::getView()
abstract public getView ( ) : View
return yii\web\View the view object that can be used to render views or view files.

init() public method

This method will register the bootstrap asset bundle. If you override this method, make sure you call the parent implementation first.
public init ( )

registerClientEvents() protected method

Registers JS event handlers that are listed in [[clientEvents]].
Since: 2.0.2
protected registerClientEvents ( )

registerPlugin() protected method

Registers a specific Bootstrap plugin and the related events
protected registerPlugin ( string $name )
$name string the name of the Bootstrap plugin

Property Details

$clientEvents public property

the event handlers for the underlying Bootstrap JS plugin. Please refer to the corresponding Bootstrap plugin Web page for possible events. For example, this page shows how to use the "Modal" plugin and the supported events (e.g. "shown").
public $clientEvents

$clientOptions public property

the options for the underlying Bootstrap JS plugin. Please refer to the corresponding Bootstrap plugin Web page for possible options. For example, this page shows how to use the "Modal" plugin and the supported options (e.g. "remote").
public $clientOptions