2017 © Pedro Peláez
 

yii2-extension yii2-treeview

A Bootstrap Treeview Generator for AdminLte Sidebar

image

meysampg/yii2-treeview

A Bootstrap Treeview Generator for AdminLte Sidebar

  • Monday, October 24, 2016
  • by meysampg
  • Repository
  • 1 Watchers
  • 1 Stars
  • 100 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 18 % Grown

The README.md

Yii2 Treeview

🟥⚠️ THIS PACKAGE IS ABANDONED. PLEASE SELECT ANOTHER PACKAGE OR FORK THIS REPOSITRY AND INFORM ME ON p.g.meysam [at] gmail [dot] com TO REFFER TO YOUR PACKAGE IN PACKAGIST ⚠️🟥, (*1)

A Bootstrap Treeview Generator for AdminLte Sidebar, (*2)

Description

It's just an extended version of yii\bootstrap\Nav for generating proper code for sidebar of AdminLte with support of badgets., (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

composer require meysampg/yii2-treeview "*"

or add, (*6)

"meysampg/yii2-treeview": "*"

to the require section of your composer.json file., (*7)

Usage

Once the extension is installed, simply use it in your code by:, (*8)

use meysampg\treeview\Treeview;

and use it on your code by, (*9)

<!-- sidebar menu: : style can be found in sidebar.less -->
<?= Treeview::widget([
    'items' => [
      [
          'label' => Yii::t('app', 'Dashboard'),
          'icon' => 'fa fa-dashboard',
          'url' => Url::home(),
      ],
      [
          'label' => Yii::t('app', 'Messages'),
          'icon' => 'fa fa-envelope',
          'items' => [
              [
                  'label' => Yii::t('app', 'Inbox'),
                  'url' => ['/message/inbox'],
              ],
              [
                  'label' => Yii::t('app', 'Outbox'),
                  'url' => ['/message/outbox'],
              ],
              [
                  'label' => Yii::t('app', 'Create'),
                  'url' => ['/message/create'],
              ],
          ],
      ],
    ]
]) ?>

And simply output is what is needed:, (*10)

dashboard_lte, (*11)

Examples

H‍‍‍ere is a RTL example:, (*12)

<!-- sidebar menu: : style can be found in sidebar.less -->
<?= Treeview::widget([
    'items' => [
        [
            'label' => 'داشبورد',
            'icon' => 'fa fa-dashboard',
            'url' => Url::home(),
        ],
        [
            'label' => 'پیام‌ها',
            'icon' => 'fa fa-envelope',
            'items' => [
                [
                    'label' => 'صندوق ورودی',
                    'url' => ['/message/inbox'],
                    'badget' => [
                        'text' => 4,
                        'color' => 'label-info',
                        'float' => 'left',
                    ],
                ],
                [
                    'label' => 'صندوق خروجی',
                    'url' => ['/message/outbox'],
                ],
                [
                    'label' => 'ایجاد پیام',
                    'url' => ['/message/create'],
                ],
            ],
        ],
    ]
]) ?>

dashboard_lte_rtl, (*13)

and a LTR example:, (*14)

<!-- sidebar menu: : style can be found in sidebar.less -->
<?= Treeview::widget([
    'items' => [
        [
            'label' => 'Dashboard',
            'icon' => 'fa fa-dashboard',
            'url' => Url::home(),
        ],
        [
            'label' => 'Message',
            'icon' => 'fa fa-envelope',
            'items' => [
                [
                    'label' => 'Inbox',
                    'url' => ['/message/inbox'],
                    'badget' => [
                        'text' => 4,
                        'color' => 'label-info',
                    ],
                ],
                [
                    'label' => 'Outbox',
                    'url' => ['/message/outbox'],
                ],
                [
                    'label' => 'Create',
                    'url' => ['/message/create'],
                ],
            ],
        ],
    ]
]) ?>

dashboard_lte_ltr, (*15)

Configuration

There is no much configuration for this extension. Just it's needed to send an array of sidebar items to items property of Treeview. Also for color property of badget It can be a CSS class with color, for continence you can use this values:, (*16)

  • label-default
  • label-success
  • label-info
  • label-danger
  • label-warning

Contribution

Report bugs, request a feature or do your modification and send a pull request :)., (*17)

The Versions

24/10 2016

dev-master

9999999-dev

A Bootstrap Treeview Generator for AdminLte Sidebar

  Sources   Download

MIT

The Requires

 

by Meysam P.G.

extension yii2 generator adminlte treeview sidebar

24/10 2016

v1.0.1

1.0.1.0

A Bootstrap Treeview Generator for AdminLte Sidebar

  Sources   Download

MIT

The Requires

 

by Meysam P.G.

extension yii2 generator adminlte treeview sidebar

24/10 2016

v1.0

1.0.0.0

A Bootstrap Treeview Generator for AdminLte Sidebar

  Sources   Download

MIT

The Requires

 

by Meysam P.G.

extension yii2 generator adminlte treeview sidebar