Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active May 10, 2024 12:18
Show Gist options
  • Save Kcko/2f65baa2e3b1727ebabce4d6637bb37c to your computer and use it in GitHub Desktop.
Save Kcko/2f65baa2e3b1727ebabce4d6637bb37c to your computer and use it in GitHub Desktop.
<!-- component definition -->
{define badge, bool $show = true, string $title = '', $class = null}
<span class="badge ms-2 font-size-small {$class ?? 'bg-body-secondary text-body'}" n:if="$show" title="{$title}">
{block content}{/block}
</span>
{/define}
<!-- usage -->
{embed badge, $client !== null, 'Uhrazeno'}
{block content}
<i class="mdi mdi-check text-success"></i>
{$client->totalInvoicePricePaid|price:0}
{/block}
{/embed}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment