PHPackages                             reine/yii2-widget-datatables - 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. reine/yii2-widget-datatables

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

reine/yii2-widget-datatables
============================

DataTables widget for Yii2 with Bootstrap 4

v1.5.1(7y ago)24.8k↓72.7%1MITPHP

Since May 26Pushed 6y agoCompare

[ Source](https://github.com/reine/yii2-widget-datatables)[ Packagist](https://packagist.org/packages/reine/yii2-widget-datatables)[ RSS](/packages/reine-yii2-widget-datatables/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (6)Versions (16)Used By (0)

DataTables widget for Yii2
==========================

[](#datatables-widget-for-yii2)

This extension provides the [DataTables](https://github.com/DataTables/DataTables) integration for the Yii2 framework.

[![Latest Stable Version](https://camo.githubusercontent.com/517462c38a5831e8cec9e2a1ace968d3b31410e8fef03afbe2c01a2f40b92709/68747470733a2f2f706f7365722e707567782e6f72672f7265696e652f796969322d7769646765742d646174617461626c65732f762f737461626c65)](https://packagist.org/packages/reine/yii2-widget-datatables) [![Total Downloads](https://camo.githubusercontent.com/3bf04e11f113baf0f530b95f3fd0ee28da2771e5cfd50bdfc4839b1021ed4483/68747470733a2f2f706f7365722e707567782e6f72672f7265696e652f796969322d7769646765742d646174617461626c65732f646f776e6c6f616473)](https://packagist.org/packages/reine/yii2-widget-datatables) [![Latest Unstable Version](https://camo.githubusercontent.com/e0892bd42ac8dca5d8094395cf5ae5da4bdaa1d8686a435b2a778bc8187655c6/68747470733a2f2f706f7365722e707567782e6f72672f7265696e652f796969322d7769646765742d646174617461626c65732f762f756e737461626c65)](https://packagist.org/packages/reine/yii2-widget-datatables) [![License](https://camo.githubusercontent.com/389ed1509e4853c196c3e3940ddc7816a12a0b7e32f46c8fd367b65f3a0674c8/68747470733a2f2f706f7365722e707567782e6f72672f7265696e652f796969322d7769646765742d646174617461626c65732f6c6963656e7365)](https://packagist.org/packages/reine/yii2-widget-datatables)

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

[](#installation)

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

Either run

```
composer require --prefer-dist reine/yii2-widget-datatables "^0.1.1"
```

or add

```
"reine/yii2-widget-datatables": "^0.1.1"

```

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

Usage
-----

[](#usage)

Use DataTables as any other other Yii2 widget.

```
# In controller, prepare data that will be passed to the view:

    public function actionIndex()
    {
        $searchModel = new ModelSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $this->_pageSize);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

# In view:
