Final Class Yiisoft\Yii\Bulma\Dropdown
| Inheritance | Yiisoft\Yii\Bulma\Dropdown » Yiisoft\Widget\Widget |
|---|
The dropdown component is a container for a dropdown button and a dropdown menu.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| attributes() | Returns a new instance with the specified HTML attributes for widget. | Yiisoft\Yii\Bulma\Dropdown |
| autoIdPrefix() | Returns a new instance with the specified prefix to the automatically generated widget IDs. | Yiisoft\Yii\Bulma\Dropdown |
| buttonAttributes() | Returns a new instance with the specified HTML attributes for the dropdown button. | Yiisoft\Yii\Bulma\Dropdown |
| buttonIconAttributes() | Returns a new instance with the specified HTML attributes for the dropdown button icon. | Yiisoft\Yii\Bulma\Dropdown |
| buttonIconCssClass() | Returns a new instance with the specified icon CSS class for the dropdown button. | Yiisoft\Yii\Bulma\Dropdown |
| buttonIconText() | Returns a new instance with the specified icon text for the dropdown button. | Yiisoft\Yii\Bulma\Dropdown |
| buttonLabel() | Returns a new instance with the specified label for the dropdown button. | Yiisoft\Yii\Bulma\Dropdown |
| buttonLabelAttributes() | Returns a new instance with the specified HTML attributes for the dropdown button label. | Yiisoft\Yii\Bulma\Dropdown |
| contentCssClass() | Returns a new instance with the specified CSS class for dropdown content. | Yiisoft\Yii\Bulma\Dropdown |
| cssClass() | Returns a new instance with the specified CSS class for the dropdown container. | Yiisoft\Yii\Bulma\Dropdown |
| dividerCssClass() | Returns a new instance with the specified CSS class for horizontal line separating dropdown items. | Yiisoft\Yii\Bulma\Dropdown |
| enclosedByContainer() | Returns a new instance with the specified if the widget should be enclosed by container. | Yiisoft\Yii\Bulma\Dropdown |
| id() | Returns a new instance with the specified ID of the widget. | Yiisoft\Yii\Bulma\Dropdown |
| itemActiveCssClass() | Returns a new instance with the specified CSS class for active dropdown item. | Yiisoft\Yii\Bulma\Dropdown |
| itemCssClass() | Returns a new instance with the specified CSS class for dropdown item. | Yiisoft\Yii\Bulma\Dropdown |
| itemDisabledStyleCss() | Returns a new instance with the specified style attributes for disabled dropdown item. | Yiisoft\Yii\Bulma\Dropdown |
| itemHeaderCssClass() | Returns a new instance with the specified CSS class for dropdown item header. | Yiisoft\Yii\Bulma\Dropdown |
| items() | Returns a new instance with the specified list of items. | Yiisoft\Yii\Bulma\Dropdown |
| menuCssClass() | Returns a new instance with the specified dropdown menu CSS class. | Yiisoft\Yii\Bulma\Dropdown |
| render() | Yiisoft\Yii\Bulma\Dropdown | |
| submenu() | Returns a new instance with the specified if it is a submenu or sub-dropdown. | Yiisoft\Yii\Bulma\Dropdown |
| submenuAttributes() | Returns a new instance with the specified HTML attributes for sub-menu container tag. | Yiisoft\Yii\Bulma\Dropdown |
| triggerCssClass() | Returns a new instance with the specified dropdown trigger CSS class. | Yiisoft\Yii\Bulma\Dropdown |
Method Details
Returns a new instance with the specified HTML attributes for widget.
| public self attributes ( array $values ) | ||
| $values | array |
Attribute values indexed by attribute names. {@see \Yiisoft\Html\Html::renderTagAttributes()} For details on how attributes are being rendered. |
public function attributes(array $values): self
{
$new = clone $this;
$new->attributes = $values;
return $new;
}
Returns a new instance with the specified prefix to the automatically generated widget IDs.
| public self autoIdPrefix ( string $value ) | ||
| $value | string |
The prefix to the automatically generated widget IDs. |
public function autoIdPrefix(string $value): self
{
$new = clone $this;
$new->autoIdPrefix = $value;
return $new;
}
Returns a new instance with the specified CSS class for dropdown content.
| public self contentCssClass ( string $value ) | ||
| $value | string |
The CSS class. |
public function contentCssClass(string $value): self
{
$new = clone $this;
$new->contentCssClass = $value;
return $new;
}
Returns a new instance with the specified CSS class for the dropdown container.
| public self cssClass ( string $value ) | ||
| $value | string |
The CSS class. |
public function cssClass(string $value): self
{
$new = clone $this;
$new->cssClass = $value;
return $new;
}
Returns a new instance with the specified CSS class for horizontal line separating dropdown items.
| public self dividerCssClass ( string $value ) | ||
| $value | string |
The CSS class. |
public function dividerCssClass(string $value): self
{
$new = clone $this;
$new->dividerCssClass = $value;
return $new;
}
Returns a new instance with the specified if the widget should be enclosed by container.
| public self enclosedByContainer ( boolean $value = false ) | ||
| $value | boolean |
Whether the widget should be enclosed by container. Defaults to true. |
public function enclosedByContainer(bool $value = false): self
{
$new = clone $this;
$new->encloseByContainer = $value;
return $new;
}
Returns a new instance with the specified ID of the widget.
| public self id ( string $value ) | ||
| $value | string |
The ID of the widget. |
public function id(string $value): self
{
$new = clone $this;
$new->attributes['id'] = $value;
return $new;
}
Returns a new instance with the specified CSS class for active dropdown item.
| public self itemActiveCssClass ( string $value ) | ||
| $value | string |
The CSS class. |
public function itemActiveCssClass(string $value): self
{
$new = clone $this;
$new->itemActiveCssClass = $value;
return $new;
}
Returns a new instance with the specified CSS class for dropdown item.
| public self itemCssClass ( string $value ) | ||
| $value | string |
The CSS class. |
public function itemCssClass(string $value): self
{
$new = clone $this;
$new->itemCssClass = $value;
return $new;
}
Returns a new instance with the specified style attributes for disabled dropdown item.
| public self itemDisabledStyleCss ( string $value ) | ||
| $value | string |
The CSS class. |
public function itemDisabledStyleCss(string $value): self
{
$new = clone $this;
$new->itemDisabledStyleCss = $value;
return $new;
}
Returns a new instance with the specified CSS class for dropdown item header.
| public self itemHeaderCssClass ( string $value ) | ||
| $value | string |
The CSS class. |
public function itemHeaderCssClass(string $value): self
{
$new = clone $this;
$new->itemHeaderCssClass = $value;
return $new;
}
Returns a new instance with the specified list of items.
Each array element can be either an HTML string, or an array representing a single menu with the following structure:
- label: string, required, the label of the item link.
- encode: bool, optional, whether to HTML-encode item label.
- url: string|array, optional, the URL of the item link. This will be processed by {@see \Yiisoft\Yii\Bulma\currentPath}. If not set, the item will be treated as a menu header when the item has no sub-menu.
- visible: bool, optional, whether this menu item is visible. Defaults to true.
- urlAttributes: array, optional, the HTML attributes of the item link.
- items: array, optional, the submenu items. The structure is the same as this property. Note that Bootstrap doesn't support dropdown submenu. You have to add your own CSS styles to support it.
- submenuAttributes: array, optional, the HTML attributes for sub-menu container tag. If specified it will be merged with {@see \Yiisoft\Yii\Bulma\submenuAttributes}.
To insert divider use -.
| public self items ( array $value ) | ||
| $value | array |
The menu items. |
public function items(array $value): self
{
$new = clone $this;
$new->items = $value;
return $new;
}
| public string render ( ) | ||
| throws | \Yiisoft\Definitions\Exception\CircularReferenceException|\Yiisoft\Definitions\Exception\InvalidConfigException|\Yiisoft\Factory\NotFoundException|\Yiisoft\Definitions\Exception\NotInstantiableException | |
|---|---|---|
public function render(): string
{
return $this->renderDropdown();
}
Returns a new instance with the specified dropdown trigger CSS class.
| public self triggerCssClass ( string $value ) | ||
| $value | string |
The CSS class. |
public function triggerCssClass(string $value): self
{
$new = clone $this;
$new->triggerCssClass = $value;
return $new;
}
Signup or Login in order to comment.