PHP Class yii\bootstrap\ButtonDropdown

For example, php a button group using Dropdown widget echo ButtonDropdown::widget([ 'label' => 'Action', 'dropdown' => [ 'items' => [ ['label' => 'DropdownA', 'url' => '/'], ['label' => 'DropdownB', 'url' => '#'], ], ], ]);
See also: http://getbootstrap.com/javascript/#buttons
See also: http://getbootstrap.com/components/#btn-dropdowns
Since: 2.0
Author: Antonio Ramirez ([email protected])
Inheritance: extends yii\bootstrap\Widget
Datei anzeigen Open project: yiisoft/yii2-bootstrap Class Usage Examples

Public Properties

Property Type Description
$containerOptions the HTML attributes for the container tag. The following special options are recognized: - tag: string, defaults to "div", the name of the container tag.
$dropdown the configuration array for Dropdown.
$dropdownClass name of a class to use for rendering dropdowns withing this widget. Defaults to Dropdown.
$encodeLabel whether the label should be HTML-encoded.
$label the button label
$options the HTML attributes of the button.
$split whether to display a group of split-styled button group.
$tagName the tag to use to render the button

Public Methods

Method Description
run ( ) Renders the widget.

Protected Methods

Method Description
renderButton ( ) : string Generates the button dropdown.
renderDropdown ( ) : string Generates the dropdown menu.

Method Details

renderButton() protected method

Generates the button dropdown.
protected renderButton ( ) : string
return string the rendering result.

renderDropdown() protected method

Generates the dropdown menu.
protected renderDropdown ( ) : string
return string the rendering result.

run() public method

Renders the widget.
public run ( )

Property Details

$containerOptions public_oe property

the HTML attributes for the container tag. The following special options are recognized: - tag: string, defaults to "div", the name of the container tag.
See also: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
Since: 2.0.1
public $containerOptions

$dropdown public_oe property

the configuration array for Dropdown.
public $dropdown

$dropdownClass public_oe property

name of a class to use for rendering dropdowns withing this widget. Defaults to Dropdown.
Since: 2.0.7
public $dropdownClass

$encodeLabel public_oe property

whether the label should be HTML-encoded.
public $encodeLabel

$label public_oe property

the button label
public $label

$options public_oe property

the HTML attributes of the button.
See also: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $options

$split public_oe property

whether to display a group of split-styled button group.
public $split

$tagName public_oe property

the tag to use to render the button
public $tagName