Final Class Yiisoft\Yii\Bulma\Nav
| Inheritance | Yiisoft\Yii\Bulma\Nav » Yiisoft\Widget\Widget |
|---|
Nav renders a nav HTML component.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| activateParents() | Returns a new instance with the specified whether to activate parent menu items when one of the corresponding child menu items is active. | Yiisoft\Yii\Bulma\Nav |
| attributes() | Returns a new instance with the specified HTML attributes for widget. | Yiisoft\Yii\Bulma\Nav |
| currentPath() | Returns a new instance with the specified allows you to assign the current path of the url from request controller. | Yiisoft\Yii\Bulma\Nav |
| enclosedByEndMenu() | Returns a new instance with the specified align the menu items to the right. | Yiisoft\Yii\Bulma\Nav |
| enclosedByStartMenu() | Returns a new instance with the specified align the menu items to left. | Yiisoft\Yii\Bulma\Nav |
| items() | Returns a new instance with the specified items. | Yiisoft\Yii\Bulma\Nav |
| render() | Yiisoft\Yii\Bulma\Nav | |
| withoutActivateItems() | Returns a new instance with the specified disable activate items according to whether their currentPath. | Yiisoft\Yii\Bulma\Nav |
Method Details
Returns a new instance with the specified whether to activate parent menu items when one of the corresponding child menu items is active.
| public self activateParents ( ) |
public function activateParents(): self
{
$new = clone $this;
$new->activateParents = true;
return $new;
}
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 allows you to assign the current path of the url from request controller.
| public self currentPath ( string $value ) | ||
| $value | string |
The current path. |
public function currentPath(string $value): self
{
$new = clone $this;
$new->currentPath = $value;
return $new;
}
Returns a new instance with the specified align the menu items to the right.
| public self enclosedByEndMenu ( ) |
public function enclosedByEndMenu(): self
{
$new = clone $this;
$new->enclosedByEndMenu = true;
return $new;
}
Returns a new instance with the specified align the menu items to left.
| public self enclosedByStartMenu ( ) |
public function enclosedByStartMenu(): self
{
$new = clone $this;
$new->enclosedByStartMenu = true;
return $new;
}
Returns a new instance with the specified items.
Each array element represents a single menu item which can be either a string or an array with the following structure:
- label: string, required, the nav item label.
- url: optional, the item's URL. Defaults to "#".
- urlAttributes: optional, the attributes to be rendered in the item's URL.
- visible: bool, optional, whether this menu item is visible. Defaults to true.
- linkAttributes: array, optional, the HTML attributes of the item's link.
- active: bool, optional, whether the item should be on active state or not.
- disable: bool, optional, whether the item should be disabled.
- dropdownAttributes: array, optional, the HTML options that will be passed to the {@see \Yiisoft\Yii\Bulma\Dropdown} widget.
- items: array|string, optional, the configuration array for creating a {@see \Yiisoft\Yii\Bulma\Dropdown} widget, or a string representing the dropdown menu.
- encode: bool, optional, whether the label will be HTML-encoded. If set, supersedes the $encodeLabels option for only this item.
- iconAttributes: array, optional, the HTML attributes of the item's icon.
- iconCssClass: string, optional, the icon CSS class.
- iconText: string, optional, the icon text.
If a menu item is a string, it will be rendered directly without HTML encoding.
| 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->renderNav();
}
Returns a new instance with the specified disable activate items according to whether their currentPath.
{@see \Yiisoft\Yii\Bulma\isItemActive}
| public self withoutActivateItems ( ) |
public function withoutActivateItems(): self
{
$new = clone $this;
$new->activateItems = false;
return $new;
}
Signup or Login in order to comment.