Final Class Yiisoft\Yii\Bulma\Panel
| Inheritance | Yiisoft\Yii\Bulma\Panel » Yiisoft\Widget\Widget |
|---|
Panel renders a panel component.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| attributes() | Returns a new instance with the specified HTML attributes for widget. | Yiisoft\Yii\Bulma\Panel |
| autoIdPrefix() | Returns a new instance with the specified prefix to the automatically generated widget IDs. | Yiisoft\Yii\Bulma\Panel |
| blockClass() | Returns a new instance with the specified the panel block class. | Yiisoft\Yii\Bulma\Panel |
| color() | Returns a new instance with the specified panel color class. | Yiisoft\Yii\Bulma\Panel |
| cssClass() | Returns a new instance with the specified the panel class. | Yiisoft\Yii\Bulma\Panel |
| heading() | Returns a new instance with the specified panel heading. | Yiisoft\Yii\Bulma\Panel |
| headingAttributes() | Returns a new instance with the specified panel heading attributes. | Yiisoft\Yii\Bulma\Panel |
| headingClass() | Returns a new instance with the specified the panel heading class. | Yiisoft\Yii\Bulma\Panel |
| iconClass() | Returns a new instance with the specified the panel icon class. | Yiisoft\Yii\Bulma\Panel |
| id() | Returns a new instance with the specified ID of the widget. | Yiisoft\Yii\Bulma\Panel |
| isActiveClass() | Returns a new instance with the specified active tab class. | Yiisoft\Yii\Bulma\Panel |
| render() | Yiisoft\Yii\Bulma\Panel | |
| tabClass() | Returns a new instance with the specified the panel tab class. | Yiisoft\Yii\Bulma\Panel |
| tabs() | Returns a new instance with the specified panel tabs. | Yiisoft\Yii\Bulma\Panel |
| tabsAttributes() | Returns a new instance with the specified panel tabs attributes. | Yiisoft\Yii\Bulma\Panel |
| template() | Returns a new instance with the specified template. | Yiisoft\Yii\Bulma\Panel |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| COLOR_ALL | [ self::COLOR_PRIMARY, self::COLOR_LINK, self::COLOR_INFO, self::COLOR_SUCCESS, self::COLOR_WARNING, self::COLOR_DANGER, self::COLOR_DARK, ] | Yiisoft\Yii\Bulma\Panel | |
| COLOR_DANGER | 'is-danger' | Yiisoft\Yii\Bulma\Panel | |
| COLOR_DARK | 'is-dark' | Yiisoft\Yii\Bulma\Panel | |
| COLOR_INFO | 'is-info' | Yiisoft\Yii\Bulma\Panel | |
| COLOR_LINK | 'is-link' | Yiisoft\Yii\Bulma\Panel | |
| COLOR_PRIMARY | 'is-primary' | Yiisoft\Yii\Bulma\Panel | |
| COLOR_SUCCESS | 'is-success' | Yiisoft\Yii\Bulma\Panel | |
| COLOR_WARNING | 'is-warning' | Yiisoft\Yii\Bulma\Panel |
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 the panel block class.
| public self blockClass ( string $value ) | ||
| $value | string |
The block class. |
public function blockClass(string $value): self
{
$new = clone $this;
$new->blockClass = $value;
return $new;
}
Returns a new instance with the specified panel color class.
| public self color ( string $value ) | ||
| $value | string |
The panel color class. Default any color. Possible values are: Panel::COLOR_PRIMARY, Panel::COLOR_INFO, Panel::COLOR_SUCCESS, Panel::COLOR_WARNING, Panel::COLOR_DANGER, Panel::COLOR_DARK |
public function color(string $value): self
{
if (!in_array($value, self::COLOR_ALL, true)) {
$values = implode(' ', self::COLOR_ALL);
throw new InvalidArgumentException("Invalid color. Valid values are: \"$values\".");
}
$new = clone $this;
$new->color = $value;
return $new;
}
Returns a new instance with the specified the panel class.
| public self cssClass ( string $value ) | ||
| $value | string |
The panel class. |
public function cssClass(string $value): self
{
$new = clone $this;
$new->panelClass = $value;
return $new;
}
Returns a new instance with the specified panel heading.
| public self heading ( string $value ) | ||
| $value | string |
The panel heading. |
public function heading(string $value): self
{
$new = clone $this;
$new->heading = $value;
return $new;
}
Returns a new instance with the specified panel heading attributes.
| public self headingAttributes ( array $values ) | ||
| $values | array |
Attribute values indexed by attribute names. |
public function headingAttributes(array $values): self
{
$new = clone $this;
$new->headingAttributes = $values;
return $new;
}
Returns a new instance with the specified the panel heading class.
| public self headingClass ( string $value ) | ||
| $value | string |
The heading class. |
public function headingClass(string $value): self
{
$new = clone $this;
$new->headingClass = $value;
return $new;
}
Returns a new instance with the specified the panel icon class.
| public self iconClass ( string $value ) | ||
| $value | string |
The icon class. |
public function iconClass(string $value): self
{
$new = clone $this;
$new->iconClass = $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 active tab class.
| public self isActiveClass ( string $value ) | ||
| $value | string |
The active tab class. |
public function isActiveClass(string $value): self
{
$new = clone $this;
$new->isActiveClass = $value;
return $new;
}
| public string render ( ) |
public function render(): string
{
$attributes = $this->attributes;
/** @var string */
$attributes['id'] ??= (Html::generateId($this->autoIdPrefix) . '-panel');
$id = $attributes['id'];
/** @var string */
$tag = $attributes['tag'] ?? 'nav';
Html::addCssClass($attributes, $this->panelClass);
if ($this->color !== '') {
Html::addCssClass($attributes, $this->color);
}
return strtr($this->template, [
'{panelBegin}' => Html::openTag($tag, $attributes) . PHP_EOL,
'{panelHeading}' => $this->renderHeading(),
'{panelTabs}' => $this->renderTabs($id),
'{panelItems}' => implode('', $this->tabItems),
'{panelEnd}' => Html::closeTag($tag),
]);
}
Returns a new instance with the specified the panel tab class.
| public self tabClass ( string $value ) | ||
| $value | string |
The tab class. |
public function tabClass(string $value): self
{
$new = clone $this;
$new->tabClass = $value;
return $new;
}
Returns a new instance with the specified panel tabs.
| public self tabs ( array $value ) | ||
| $value | array |
The panel tabs. |
public function tabs(array $value): self
{
$new = clone $this;
$new->tabs = $value;
return $new;
}
Returns a new instance with the specified panel tabs attributes.
| public self tabsAttributes ( array $values ) | ||
| $values | array |
Attribute values indexed by attribute names. |
public function tabsAttributes(array $values): self
{
$new = clone $this;
$new->tabsAttributes = $values;
return $new;
}
Returns a new instance with the specified template.
| public self template ( string $value ) | ||
| $value | string |
The string the template for rendering panel:
|
public function template(string $value): self
{
$new = clone $this;
$new->template = $value;
return $new;
}
Signup or Login in order to comment.