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

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

nightycrawl/yii2-widget-datatables-bs5
======================================

DataTables widget for Yii2 with Bootstrap 5

1.1(11mo ago)010MITPHP

Since Jun 4Pushed 11mo agoCompare

[ Source](https://github.com/nightycrawl/yii2-widget-datatables-bs5)[ Packagist](https://packagist.org/packages/nightycrawl/yii2-widget-datatables-bs5)[ RSS](/packages/nightycrawl-yii2-widget-datatables-bs5/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (3)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/332edfd53059a0bcf9929a7d4203519b06f034cb6731b5ea4c0217bd45f24f79/687474703a2f2f706f7365722e707567782e6f72672f6e6967687479637261776c2f796969322d7769646765742d646174617461626c65732d6273352f76)](https://packagist.org/packages/nightycrawl/yii2-widget-datatables-bs5) [![Total Downloads](https://camo.githubusercontent.com/6a396d355b85370f7c04638907b4530a4f0b2854845f4b321b02589d91031451/687474703a2f2f706f7365722e707567782e6f72672f6e6967687479637261776c2f796969322d7769646765742d646174617461626c65732d6273352f646f776e6c6f616473)](https://packagist.org/packages/nightycrawl/yii2-widget-datatables-bs5) [![License](https://camo.githubusercontent.com/405c6a7277d45911c80f5d4f72aa3af45a722c65e2080334a85785a8c9b6857a/687474703a2f2f706f7365722e707567782e6f72672f6e6967687479637261776c2f796969322d7769646765742d646174617461626c65732d6273352f6c6963656e7365)](https://packagist.org/packages/nightycrawl/yii2-widget-datatables-bs5)

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

[](#installation)

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

Either run

```
composer require --prefer-dist nightycrawl/yii2-widget-datatables-bs5 "^1.0"
```

or add

```
"nightycrawl/yii2-widget-datatables-bs5": "^1.0"

```

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:
