V
V
Vladislav2020-05-21 15:35:25
Yii
Vladislav, 2020-05-21 15:35:25

How to use badge AdminLTE on yii2?

How to add such a badge to the menu?
5ec67544932f6599711539.png
Here is the add-on itself: https://github.com/dmstr/yii2-adminlte-asset
I didn't find anything there in the config and description, but there are badges in the demo .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lander, 2020-05-21
@usdglander

So, in the documentation for the package it is written


If you need to separate sections of the menu then just add the header option to item in items
'items' => [
['label' => 'Gii', 'iconType' => 'far' 'icon' => 'file -code', 'url' => ['/gii']],
['label' => 'Debug', 'icon' => 'dashboard-alt', 'url' => ['/debug']] ,
['label' => 'MAIN NAVIGATION', 'header' => true], // here
// ... a group items
['label' => '', 'header' => true],
// ... a group items
['label' => '', 'header' => true],
// ...a group items
To add a badge for an item:
'items' => [
[
'label' => 'Mailbox',
'iconType' => 'far',
'icon' => 'envelope',
'url' => ['/mailbox'],
'badge' => '123'
],
]

In the array element $items add
...
'badge' => '<span class="badge badge-info right">123</span>'
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question