Add label attribute
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
<div {{ attributes }} class="{{ this.finalClasses }}">
|
<div {{ attributes }} class="{{ this.finalClasses }}">
|
||||||
|
{% if block('content') is not empty %}
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
{% else %}
|
||||||
|
{{- this.label -}}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ final class Badge
|
|||||||
* @param ?string $colour specify the colour of an objectless badge
|
* @param ?string $colour specify the colour of an objectless badge
|
||||||
* @param bool $outline if the badge should be rendered as an outline
|
* @param bool $outline if the badge should be rendered as an outline
|
||||||
*/
|
*/
|
||||||
public function mount(?BadgeableInterface $obj = null, ?string $class = null, ?string $colour = null, bool $outline = false): void
|
public function mount(?BadgeableInterface $obj = null, ?string $class = null, ?string $colour = null, ?string $label = null, bool $outline = false): void
|
||||||
{
|
{
|
||||||
if (!$obj && !$colour) {
|
if (!$obj && !$colour) {
|
||||||
throw new \RuntimeException(sprintf('You must specify either a colour an instance of "%s".', BadgeableInterface::class));
|
throw new \RuntimeException(sprintf('You must specify either a colour an instance of "%s".', BadgeableInterface::class));
|
||||||
|
|||||||
Reference in New Issue
Block a user