agik / yii2datatable
datatable yii2 models
Installs: 127
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
README
#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"}
]
});