New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

agik/yii2datatable

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agik/yii2datatable

datatable yii2 models

yii2-extension
Source
Packagist
Version
1.0.6
Version published
Total downloads
154
Maintainers
1
Created
Source

#Datatables with ActiveRecord Yii2



##On Controller or Model

use app\models\LevelAccess; 
use agik\yii2datatable\Table;
$dt=new Table(LevelAccess::find());
//if using join
$dt->model->joinWith('menu');
//if using join
$dt->model->joinWith('levelUser');
 return $dt->getRow();

##On your JS File

var tb=$('#table').dataTable({
				"ajax": {
          "url": "http://",
          'type':'get'
        },
        "serverSide":true/false,
        columns:[
{"data":"table_name.column_name"}
        ]
    });

FAQs

Package last updated on 07 Sep 2018

Related posts