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.
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
abstract public getView ( ) : View |
return |
yii\web\View |
the view object that can be used to render views or view files. |
This method will register the bootstrap asset bundle. If you override this method,
make sure you call the parent implementation first.
registerClientEvents()
protected method
Registers JS event handlers that are listed in [[clientEvents]].
registerPlugin()
protected method
Registers a specific Bootstrap plugin and the related events
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").
$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").