slavkovrn/yii2-dtreemenu

Yii2 dTree 2.05 Menu widget

Installs: 8 757

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 0

Language:JavaScript

Type:yii2-extension

v1.0.0 2019-05-02 21:52 UTC

This package is auto-updated.

Last update: 2024-11-26 02:40:45 UTC


README

http://yii2.kadastrcard.ru/dtree

The extension uses dTree 2.05 and makes treeview menu from php array of structure defined.

DtreeMenu PHP Array generator.

Dtree Menu

Installation

The preferred way to install this extension is through composer.

Either run:

composer require slavkovrn/yii2-dtreemenu

or add

"slavkovrn/yii2-dtreemenu": "*"

to the require section of your composer.json file.

Usage

Set link to extension in your view:

<?php

use slavkovrn\dtreemenu\DtreeMenuWidget;

$tree=[
    0 => [
            'name' => 'Menu0 name',
            'description' => 'Tool tip description for Menu0',
            'href' => '/link_when_DblClicked.html',
            'children' => [
                1 => [
                        'name' => 'SubMenu1 name',
                        'description' => 'Tool tip description for SubMenu1',
                        'href' => '/link_when_DblClicked.html',
                        'children' => [
                            2 => [
                                    'name' => 'SubSubMenu2 name',
                                    'description' => 'Tool tip description for SubSubMenu2',
                                    'href' => '/link_when_DblClicked.html',
                                    'children' => [
                                         3 => [
                                                'name' => 'SubSubSubMenu3 name',
                                                'description' => 'Tool tip description for SubSubSubMenu3',
                                                'href' => '/link_when_DblClicked.html',
                                            ],
                                        4 => [
                                                'name' => 'SubSubSubMenu4 name',
                                                'description' => 'Tool tip description for SubSubSubMenu4',
                                                'href' => '/link_when_DblClicked.html',
                                            ],
                                   ]
                                ],
                            5 => [
                                    'name' => 'SubSubMenu5 name',
                                    'description' => 'Tool tip description for SubSubMenu5',
                                    'href' => '/link_when_DblClicked.html',
                                ],
                            6 => [
                                    'name' => 'SubSubMenu6 name',
                                    'description' => 'Tool tip description for SubSubMenu6',
                                    'href' => '/link_when_DblClicked.html',
                                ],
                        ]
                    ],
                7 => [
                        'name' => 'SubMenu7 name',
                        'description' => 'Tool tip description for SubMenu7',
                        'href' => '/link_when_DblClicked.html',
                    ],
                8 => [
                        'name' => 'SubMenu8 name',
                        'description' => 'Tool tip description for SubMenu8',
                        'href' => '/link_when_DblClicked.html',
                    ],
           ]
        ],
    9 => [
            'name' => 'Menu9 name',
            'description' => 'Tool tip description for Menu9',
            'href' => '/link_when_DblClicked.html',
        ],
    10 => [
            'name' => 'Menu10 name',
            'description' => 'Tool tip description for Menu10',
            'href' => '/link_when_DblClicked.html',
        ],
];
?>

<?= DtreeMenuWidget::widget([
	'id' => 'dtree',
	'class' => 'dtree',
	'tree' => $tree,
	'target' => '_blank',
	'useSelection' => false,
	'useLines' => true,
	'useIcons' => true,
	'useCookies' => true,
	'useStatusText' => false,
	'closeSameLevel' => true,
]) ?>

write comments to admin