PHPackages                             wubbleyou/yii2-ordermodel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wubbleyou/yii2-ordermodel

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

wubbleyou/yii2-ordermodel
=========================

Allows users to order records in a grid view via a custom column

1.0.3(10y ago)011.3k↓50%BSD-2-ClausePHP

Since Jan 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Wubbleyou/yii2-ordermodel)[ Packagist](https://packagist.org/packages/wubbleyou/yii2-ordermodel)[ RSS](/packages/wubbleyou-yii2-ordermodel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

yii2-ordermodel
===============

[](#yii2-ordermodel)

Allows users to order records in a grid view via a custom column. This requires 3 minor additions:

- Attach a custom behavior to a ActiveRecord
- Attach a custom action to a Controller
- Attach a custom column to a GridView

Installation
============

[](#installation)

Either run

```
php composer.phar require --prefer-dist wubbleyou/yii2-ordermodel "*"

```

or add

```
"wubbleyou/yii2-ordermodel": "*"

```

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

Usage
=====

[](#usage)

After installing the extension the following is required.

Adding the custom behavior to a ActiveRecord:

```
    public function behaviors()
    {
        return [
            [
                'class' => OrderBehavior::className(),
                'sortField => 'sort_attribute_name',
                'restrictBy' => ['parent_category_name'] //optional
           ],
        ];
    }

```

Adding the custom column to a GridView:

```
    public function actions()
    {
        return [
            'order' => array(
                'class' => OrderModelAction::className(),
                'columns' => ['order']
            ),
        ];
    }

```

Adding the custom column to a GridView

```

  GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            'id',
            'name',
            [
              'class' => OrderModelColumn::className(),
              'attribute' => 'order'],

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]);

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~0 days

Total

4

Last Release

3758d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dfd5e4243f46321d051e985fbd72c28e91ba23a007b2eac4cb8a0d4a9564698?d=identicon)[wubbleyou](/maintainers/wubbleyou)

---

Top Contributors

[![Mark-Renney](https://avatars.githubusercontent.com/u/2581150?v=4)](https://github.com/Mark-Renney "Mark-Renney (7 commits)")

---

Tags

yii2extensiongridview

### Embed Badge

![Health badge](/badges/wubbleyou-yii2-ordermodel/health.svg)

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

###  Alternatives

[richardfan1126/yii2-sortable-gridview

Sortable GridView for Yii2

29189.3k](/packages/richardfan1126-yii2-sortable-gridview)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[sjaakp/yii2-alphapager

Page data on initial character in Yii2.

184.4k](/packages/sjaakp-yii2-alphapager)

PHPackages © 2026

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