PHPackages                             m-comscience/yii2-data-column - 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. [Framework](/categories/framework)
4. /
5. m-comscience/yii2-data-column

ActiveYii2-extension[Framework](/categories/framework)

m-comscience/yii2-data-column
=============================

Data Column for Yii2 framework

v1.0.0(7y ago)0641BSD-3-ClausePHP

Since Nov 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MComScience/yii2-data-column)[ Packagist](https://packagist.org/packages/m-comscience/yii2-data-column)[ Docs](https://github.com/MComScience/yii2-data-column)[ RSS](/packages/m-comscience-yii2-data-column/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

Yii2 Extension
==============

[](#yii2-extension)

Requirements
------------

[](#requirements)

The minimum requirement is that your Web server supports PHP 7.0 or &gt;.

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

[](#installation)

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

```
composer require m-comscience/yii2-data-column '@dev'

```

Usage
-----

[](#usage)

Controller

```
use mcomscience\data\DataColumn;
use mcomscience\data\ActionColumn;
use yii\data\ArrayDataProvider;

public function ActionDataServiceGroup()
{
    \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
    $query = (new \yii\db\Query())
        ->select([
            'tb_service_group.*',
        ])
        ->from('tb_service_group')
        ->all();
    $dataProvider = new ArrayDataProvider([
        'allModels' => $query,
    ]);
    // or
    /*
    use yii\data\ActiveDataProvider;

    $query = Post::find()->where(['status' => 1]);

    $dataProvider = new ActiveDataProvider([
        'query' => $query,
        'sort' => [
            'defaultOrder' => [
                'created_at' => SORT_DESC,
                'title' => SORT_ASC,
            ]
        ],
    ]);
    */
    $columns = Yii::createObject([
        'class' => DataColumn::className(),
        'dataProvider' => $dataProvider,
        'formatter' => Yii::$app->formatter,
        'columns' => [
            [
                'attribute' => 'service_group_id',
            ],
            [
                'attribute' => 'service_group_name',
            ],
            [
                'attribute' => 'service_group_status',
                'value' => function ($model, $key, $index) {
                    return static::getBadgeStatus($model['service_group_status']);
                },
                'format' => 'raw',
            ],
            [
                'class' => ActionColumn::className(),
                'template' => '{view} {update} {delete}',
                'viewOptions' => [
                    'title' => Yii::t('yii','View'),
                    //'label' => 'View'
                ],
                'updateOptions' => [
                    'role' => 'modal-remote',
                    'title' => Yii::t('yii','Edit'),
                ],
                'deleteOptions' => [
                    'class' => 'text-danger on-delete',
                    'title' => Yii::t('yii','Delete'),
                ],
                'urlCreator' => function ($action, $model, $key, $index) {
                    if ($action == 'update') {
                        return Url::to(['/app/settings/update-service-group', 'id' => $key]);
                    }
                    if ($action == 'delete') {
                        return Url::to(['/app/settings/delete-service-group', 'id' => $key]);
                    }
                },
            ],
            /*
            DropdownButton
            [
                'class' => ActionColumn::className(),
                'template' => '{view} {btn1}',
                'dropdown' => true,
                'dropdownButton' => [
                    'label' => 'Actions',
                    'class' => 'btn btn-success'
                ],
                'viewOptions' => [
                    'role' => 'modal-remote',
                    'title' => 'Detail',
                    'label' => 'Detail',
                ],
                'buttons' => [
                    'btn1' => function ($url, $model, $key) {
                        return Html::tag('li', Html::a('Add', $url, ['data-pjax' => 0]));
                    },
                ],
                'urlCreator' => function ($action, $model, $key, $index) {
                    if ($action == 'view') {
                        return Url::to(['view', 'id' => $key]);
                    }
                },
            ],
            */
        ],
    ]);
    return $columns->renderDataColumns();
}
```

Result

```
[
    {
        "service_group_id": 1,
        "service_group_name": "Example1",
        "service_group_status": "Active",
        "actions": "html format"
    },
    {
        "service_group_id": 2,
        "service_group_name": "Example2",
        "service_group_status": "Active",
        "actions": "html format"
    },
];

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

Unknown

Total

1

Last Release

2732d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f07077991bfb47848a8396ab5d1119a34eef5f998246566906f3da1d23aa74f1?d=identicon)[m-comscience](/maintainers/m-comscience)

---

Top Contributors

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

---

Tags

yii2extensionyii2 data column

### Embed Badge

![Health badge](/badges/m-comscience-yii2-data-column/health.svg)

```
[![Health](https://phpackages.com/badges/m-comscience-yii2-data-column/health.svg)](https://phpackages.com/packages/m-comscience-yii2-data-column)
```

###  Alternatives

[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)

PHPackages © 2026

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