PHPackages                             kadotafig/yii2-startbootstrap-sb-admin-2-asset - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kadotafig/yii2-startbootstrap-sb-admin-2-asset

ActiveYii2-extension

kadotafig/yii2-startbootstrap-sb-admin-2-asset
==============================================

This extensions is library for Startbootstrap SB Admin 2 Template with Bootstrap4

v0.1.2(5y ago)024MITPHP

Since Jul 3Pushed 4y agoCompare

[ Source](https://github.com/kadotafig/yii2-startbootstrap-sb-admin-2-asset)[ Packagist](https://packagist.org/packages/kadotafig/yii2-startbootstrap-sb-admin-2-asset)[ RSS](/packages/kadotafig-yii2-startbootstrap-sb-admin-2-asset/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (4)Used By (0)

yii2-startbootstrap-sb-admin-2-asset
====================================

[](#yii2-startbootstrap-sb-admin-2-asset)

This packages contans an Asset Bundle of [Startbootstrap SB Admin 2](https://github.com/BlackrockDigital/startbootstrap-sb-admin-2) for Yii2.

[Startbootstrap SB Admin 2](https://github.com/BlackrockDigital/startbootstrap-sb-admin-2) is a responsive [Bootstrap 4](http://getbootstrap.com/) created by [Start Bootstrap](http://startbootstrap.com/).

Preview
-------

[](#preview)

[![SB Admin 2 Preview](https://camo.githubusercontent.com/caaff31650c27a500f80144faa8527fa4ef5f909eaefec0200d3bc79d546159f/68747470733a2f2f7374617274626f6f7473747261702e636f6d2f6173736574732f696d672f73637265656e73686f74732f7468656d65732f73622d61646d696e2d322e706e67)](https://blackrockdigital.github.io/startbootstrap-sb-admin-2/)

**[Launch Live Preview](https://blackrockdigital.github.io/startbootstrap-sb-admin-2/)**

Start Bootstrap was created by and is maintained by **[David Miller](http://davidmiller.io/)**, Owner of [Blackrock Digital](http://blackrockdigital.io/).

-
-

Start Bootstrap is based on the [Bootstrap](http://getbootstrap.com/) framework created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thorton](https://twitter.com/fat).

Requirement
-----------

[](#requirement)

This Asset Bundle needs Bootstrap 4. Since Yii2 used Bootstrap 3 by default, you must install and change every Bootstrap 3 Asset to Bootstrap 4. You can read this tutorial to migrate to Yii2 Bootstrap 4 :

- English : [How to use a Bootstrap 4 theme with Yii2](https://medium.com/@jsnook_58598/how-to-use-a-bootstrap-4-theme-with-yii2-974a6dcca986)
- Bahasa Indonesia : [Pemrograman Web dengan Yii2 - Menggunakan Bootstrap 4](https://www.belajararief.com/index.php/tulisan/tekno/yii2-series/219-pemrograman-web-dengan-yii2-menggunakan-bootstrap-4)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require kadotafig/yii2-startbootstrap-sb-admin-2-asset:dev-master

```

or add

```
"kadotafig/yii2-startbootstrap-sb-admin-2-asset": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

You can see views-examples folder for example use of this library

Menu Widget
-----------

[](#menu-widget)

You can use Menu widget in your sidebar. This widget optimize for Startbootstrap SB-Admin 2 template. This widget, like SB-Admin 2, only support 2 level menu.

You can see example use of this widget in [views-exampale/views/layout/sidebar.php](https://github.com/kadotafig/yii2-startbootstrap-sb-admin-2-asset/blob/master/views-examples/views/layouts/sidebar.php).

```
use kadotafig\sbadmin2\widgets\Menu;
echo Menu::widget([
    'options' => [
        'ulClass' => "navbar-nav bg-gradient-primary sidebar sidebar-dark accordion",
        'ulId' => "accordionSidebar"
        'setToggle' => true, //optional turns on sidebarToggle
    ], //  optional
    'brand' => [
        'url' => ['/'],
        'content' =>  [
        [
            'label' => 'Menu 1',
            'url' => ['/menu1'], //  Array format of Url to, will be not used if have an items
            'icon' => 'fas fa-fw fa-tachometer-alt', // optional, default to "fa fa-circle-o
            'visible' => true, // optional, default to true
            // 'options' => [
            //     'liClass' => 'nav-item',
            // ] // optional
        ],
        [
            'type' => 'divider', // divider or sidebar, if not set then link menu
            // 'label' => '', // if sidebar we will set this, if divider then no
        ],
        [
            'label' => 'Menu 2',
            // 'icon' => 'fa fa-menu', // optional, default to "fa fa-circle-o
            'visible' => true, // optional, default to true
            // 'subMenuTitle' => 'Menu 2 Item', // optional only when have submenutitle, if not exist will not have subMenuTitle
            'items' => [
                [
                    'label' => 'Menu 2 Sub 1',
                    'url' => ['/menu21'], //  Array format of Url to, will be not used if have an items
                ],
                [
                    'label' => 'Menu 2 Sub 2',
                    'url' => ['/menu22'], //  Array format of Url to, will be not used if have an items
                ],
            ]
        ],

        [
            'label' => 'Menu 3',
            'visible' => true, // optional, default to true
            // 'subMenuTitle' => 'Menu 3 Item', // optional only when have submenutitle, if not exist will not have subMenuTitle
            'items' => [
                [
                    'label' => 'Menu 3 Sub 1',
                    'url' => ['/menu21'], //  Array format of Url to, will be not used if have an items
                ],
                [
                    'label' => 'Menu 3 Sub 2',
                    'url' => ['/menu22'], //  Array format of Url to, will be not used if have an items
                    'linkOptions' => [
                       'onClick' => 'alert("This is onClick")',
                    ]
                ],
            ]
        ],
    ]
]);
```

As you can see in above example, this Widget consist of two primary method.

MethodExplanation`options`**Optional** method. in this metod you will set any costumization of this Menu widget. It consist of `ulClass` method and `ulId` method-- `ulClass`Set your `` class of this menu. default to "navbar-nav bg-gradient-primary sidebar sidebar-dark accordion"-- `ulId`Set your `` id of this menu. default to "accordionSidebar"`items`**Required** method. You must set this method in your widget. You can set `items` inside this method and it will create sub-menu items. Items and Sub Menu Item method use the same method, except for `type` method.-- `type`**Optional** parameter, there are 3 category in this params. They are **menu, divider, and sidebar**. Default value of this params are **menu**-- `label`**Required** parameter. This param will give label to your menu-- `icon`**Optional** parameter. Will use font-awesome icon, so the value of this param will use fa class. Default to `fas fa-circle`-- `url`**Required** parameter. Use Array value, like array on `\yii\helpers\Url::to($array)`. If there are `items` parameter set, `url` will be ignored-- `visible`**Optional** paremeter. Determined the visibility of menu. Value of `visible` are boolean. Default to `true`-- `linkOptions`**Optional** paremeter. This param use array, give any options param to `a` tag, such as `onClick` or other options in link.Card Widget
-----------

[](#card-widget)

You can use card widget. This widget will create bootstrap card, optimize for this template

Example use of card are like below code

```
use kadotafig\sbadmin2\widgets\Card;
echo Card::widget([
    'type' => 'cardBorder',
    'label' => 'Label',
    'sLabel' => '1000',
    'icon' => 'fas fa-calendar',
    'iconUrl' => '/your/url', //optional
    'iconFormType' => 'modal-form', //optional if iconUrl used
    'options' => [
        'colSizeClass' => 'col-md-3',
        'borderColor' => 'primary',
    ]
]);
```

As you can see in above example, this Widget consist of some method.

MethodExplanation`type`**Optional** method. In this method you set type of your card. This widget support this type of card: `cardBorder`, ..... Default value of type is `cardBorder``label`**Required** method. In this method you set primary label of your card`sLabel`**Required** method. In this method you set secondary label of your card`icon`**Required** method. In this method you set icon of your card`options`**options** method. Set options, available options are `colSizeClass`, `borderColor`-- `colSizeClass`Set your col-size, value of this method are bootstrap col-size-- `borderColor`Set your borderColor, value of this method are bootstrap colorTODO
----

[](#todo)

Todo Widget

- Menu
- CardBorder
- CardBox
- HeaderMenu
- HeaderColor based on Params
- Etc

Creator
-------

[](#creator)

This asset wrapper was created by and is maintained by **[hoaaah](http://belajararief.com/)**.

-
-

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

3

Last Release

2108d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfea4e4ea60bb9977f806e2e07a09e98a9cc732eca5921050ba9b4ed4395e07c?d=identicon)[kadotafig](/maintainers/kadotafig)

---

Top Contributors

[![hoaaah](https://avatars.githubusercontent.com/u/8166322?v=4)](https://github.com/hoaaah "hoaaah (18 commits)")

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/kadotafig-yii2-startbootstrap-sb-admin-2-asset/health.svg)

```
[![Health](https://phpackages.com/badges/kadotafig-yii2-startbootstrap-sb-admin-2-asset/health.svg)](https://phpackages.com/packages/kadotafig-yii2-startbootstrap-sb-admin-2-asset)
```

###  Alternatives

[hail812/yii2-adminlte3

adminlte3 for yii2

79253.8k2](/packages/hail812-yii2-adminlte3)[hail812/yii2-adminlte-widgets

yii2 adminlte widgets

10246.8k4](/packages/hail812-yii2-adminlte-widgets)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
