PHPackages                             slatiusa/yii2-nestable - 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. slatiusa/yii2-nestable

ActiveYii2-extension

slatiusa/yii2-nestable
======================

Yii 2.0 implementation of nested set behavior using jquery.nestable plugin.

v1.2.1(9y ago)1918.1k11[1 issues](https://github.com/ASlatius/yii2-nestable/issues)2BSD 3-ClauseJavaScript

Since Apr 28Pushed 9y ago5 watchersCompare

[ Source](https://github.com/ASlatius/yii2-nestable)[ Packagist](https://packagist.org/packages/slatiusa/yii2-nestable)[ Docs](https://github.com/Hommer101/yii2-nestable)[ RSS](/packages/slatiusa-yii2-nestable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (2)

yii2-nestable
=============

[](#yii2-nestable)

Yii 2.0 implementation of nested set behavior using jquery.nestable plugin.

- jquery.nestable plugin:
- Nested Sets Behavior for Yii 2:

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

[](#installation)

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

Either run

```
$ php composer.phar require slatiusa/yii2-nestable "dev-master"

```

or add

```
"slatiusa/yii2-nestable": "dev-master"

```

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

Usage
-----

[](#usage)

Make sure you've attached the NestedSetsBehavior (creocoder/yii2-nested-sets) correctly to your model. Then add the node move handler to you controller by attaching the supplied action;

```
use slatiusa\nestable\Nestable;

class yourClass extends Controller
{
    public function actions() {
        return [
            'nodeMove' => [
                'class' => 'slatiusa\nestable\NodeMoveAction',
                'modelName' => TreeModel::className(),
            ],
        ];
    }

```

And then render the widget in your view;

```
echo Nestable::widget([
    'type' => Nestable::TYPE_WITH_HANDLE,
    'query' => TreeModel::find()->where([ top of tree ]),
    'modelOptions' => [
        'name' => 'name'
    ],
    'pluginEvents' => [
        'change' => 'function(e) {}',
    ],
    'pluginOptions' => [
        'maxDepth' => 7,
    ],
]);

```

You can either supply an ActiveQuery object in `query` from which a tree will be built. You can also supply an item list;

```
    ...
    'items' => [
        ['content' => 'Item # 1', 'id' => 1],
        ['content' => 'Item # 2', 'id' => 2],
        ['content' => 'Item # 3', 'id' => 3],
        ['content' => 'Item # 4 with children', 'id' => 4, 'children' => [
            ['content' => 'Item # 4.1', 'id' => 5],
            ['content' => 'Item # 4.2', 'id' => 6],
            ['content' => 'Item # 4.3', 'id' => 7],
        ]],
    ],

```

The `modelOptions['name']` should hold an attribute name that will be used to name on the items in the list. You can alternatively supply an unnamed `function($model)` to build your own content string.

Supply a `pluginEvents['change']` with some JavaScript code to catch the change event fired by jquery.nestable plugin. The `pluginOptions` accepts all the options for the original jquery.nestable plugin.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 72.2% 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 ~132 days

Total

5

Last Release

3504d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2657fab9c3af6d3bf0c2d7654821b9071403b0b22ca48a22122d7d8624823ad3?d=identicon)[slatiusa](/maintainers/slatiusa)

---

Top Contributors

[![ASlatius](https://avatars.githubusercontent.com/u/5786593?v=4)](https://github.com/ASlatius "ASlatius (13 commits)")[![cornernote](https://avatars.githubusercontent.com/u/51875?v=4)](https://github.com/cornernote "cornernote (3 commits)")[![mazurva](https://avatars.githubusercontent.com/u/1152567?v=4)](https://github.com/mazurva "mazurva (2 commits)")

---

Tags

jquerysortableyii2extensionBehaviorwidgetnestablenested-set

### Embed Badge

![Health badge](/badges/slatiusa-yii2-nestable/health.svg)

```
[![Health](https://phpackages.com/badges/slatiusa-yii2-nestable/health.svg)](https://phpackages.com/packages/slatiusa-yii2-nestable)
```

###  Alternatives

[kartik-v/yii2-widget-select2

Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).

3279.7M191](/packages/kartik-v-yii2-widget-select2)[kartik-v/yii2-sortable

Create sortable lists and grids using HTML5 drag and drop API for Yii 2.0.

433.8M13](/packages/kartik-v-yii2-sortable)[kartik-v/yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 3.x, 4.x &amp; 5.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

2286.8M95](/packages/kartik-v-yii2-widget-fileinput)[kartik-v/yii2-widget-datetimepicker

Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)

1036.5M47](/packages/kartik-v-yii2-widget-datetimepicker)[kartik-v/yii2-widget-typeahead

Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).

454.8M9](/packages/kartik-v-yii2-widget-typeahead)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)

PHPackages © 2026

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