PHPackages                             damiandennis/yii2-knockout-list - 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. damiandennis/yii2-knockout-list

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

damiandennis/yii2-knockout-list
===============================

Providing a list view constructed with Knockout js.

v0.4.2(11y ago)161BSD-3-ClausePHPPHP &gt;=5.4

Since Dec 10Pushed 10y ago1 watchersCompare

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

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

yii2-knockout-list
==================

[](#yii2-knockout-list)

**No Longer under active development. Looking for maintainer**

This is a widget that works much the same as the default ListView provided by Yii2 but with rendering done in KnockoutJS so that extending it with javascript/KnockoutJS is a breeze.

```
php composer.phar require --prefer-dist damiandennis/yii2-knockout-list
```

This widget requires a few steps to get it functional. Firstly id and dataProvider must be provided in the controller, id is compulsory unlike other yii widgets as it needs an identity and data for the callback.

Example Controller

```
use damiandennis\knockoutlist\KnockoutList;
class SiteController extends Controller
{
    public function actionIndex()
    {
        $model = new LocationSearch();
        $id = 'my-widget';
        $dataProvider = $model->search(Yii::$app->request->queryParams);
        /* $filter = function($row) {
        *      $newRow = $row->attributes; //This is default, relations etc need to be added here
        *      $newRow['Country'] = $row->country->attributes;
        *      return $newRow;
        *  }
        */
        KnockoutList::queryJsonResponse($id, $dataProvider/*, $filter*/);
        return $this->render('index', [
            'id' => $id,
            'dataProvider' => $dataProvider,
            //'filter' => $filter,
        ]);
    }
}
```

Example Index

```
use damiandennis\knockoutlist\KnockoutList;
echo KnockoutList::widget([
    'id' => $id, // The id from the controller
    'dataProvider' => $dataProvider, //The dataProvider from the controller
    'templates' => [ // These can be copied from the src/widgets/views
        //'summary' This is the summary of the page
        'items' => '_items' //If this is not included the default is the primary key.
        //'pager' This is the pager of the page.
        //'sorter' This is the sorter layout.
        //'empty' This is the empty result layout.
    ],
    //'layout' => '{summary}{items}{pager}{empty}', The layout rendering order.
    //'filter' => $filter, //The filter from the controller
    /**
     * Whether to bind this ko to the render section of html, this is mainly if you want to extend this as a bigger      * part of a project. If bindings are applied they are wrapped with no bind so they do not interfer with
     * applications that bind to the whole page. Also the view can be access via yii.knockoutlist.listView.{yourid}
     * it is wrapped with a with binding to the id of the widget. data-bind="with: yourid"
     */
    //'applyBindings' => true,
    /**
     * This provides the ability to extend the default models as they are in a private namespace to prevent
     * interference with other KnockoutList widgets on the same page. ListView is the pagination and the outer
     * section. ItemModel is the individual rows.
     */
    'extendModels' => "function(ListView, ItemModel) {
        ko.utils.extend(ItemModel.prototype, {
            extend: function() {
                this.hello = ko.observable(this.loadedData.name);
                this.clickMe = function() {
                    alert('hello');
                };
            }
        });
        ko.utils.extend(ListView.prototype, {
            extend: function() {
                this.name2 = 'hello';
            }
        });
    }",
    //'noScriptText' => "This section requires Javascript to be enabled.", // When JS is disabled.
    //'async' => false, // Loads query after page load.
    //'autoObservables' => true, // All data passed through to ItemModel with be initialised with an observable.
    //'usePushState' => false, // This is mainly used for single pages apps that want urls like pajax.
]);
```

Example \_items.php

```

    Click Me

```

Looking for a GridView instead? Try this in your \_item.php file instead.

```

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Total

6

Last Release

4164d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15df7ca5f587d83f20ca37e03e1eb02bc2085f2e978d439017f1ad29dafaa76d?d=identicon)[damiandennis](/maintainers/damiandennis)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/damiandennis-yii2-knockout-list/health.svg)

```
[![Health](https://phpackages.com/badges/damiandennis-yii2-knockout-list/health.svg)](https://phpackages.com/packages/damiandennis-yii2-knockout-list)
```

PHPackages © 2026

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