HumHub Documentation (unofficial)

BootstrapWidgetTrait

BootstrapWidgetTrait is the trait, which provides basic for all bootstrap widgets features.

Note: class, which uses this trait must declare public field named options with the array default value:

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.

Tags
author

Antonio Ramirez amigo.cobos@gmail.com

author

Qiang Xue qiang.xue@gmail.com

author

Paul Klimov klimov.paul@gmail.com

since
2.0.6

Table of Contents

Properties

$clientEvents  : array<string|int, mixed>
$clientOptions  : array<string|int, mixed>

Methods

getView()  : View
init()  : mixed
Initializes the widget.
registerClientEvents()  : mixed
Registers JS event handlers that are listed in [[clientEvents]].
registerPlugin()  : mixed
Registers a specific Bootstrap plugin and the related events

Properties

$clientEvents

public array<string|int, mixed> $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

public array<string|int, mixed> $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").

Methods

init()

Initializes the widget.

public init() : mixed

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

registerClientEvents()

Registers JS event handlers that are listed in [[clientEvents]].

protected registerClientEvents() : mixed
Tags
since
2.0.2

registerPlugin()

Registers a specific Bootstrap plugin and the related events

protected registerPlugin(string $name) : mixed
Parameters
$name : string

the name of the Bootstrap plugin


        
On this page

Search results