dev-master
9999999-devA set of common used yii2 tools
MIT
The Requires
by Trung Nguyen
yii2 utils
A set of common used yii2 tools
Yii2 common utils is a set of common used tools for Yii2 framework., (*1)
stupant\utils\PTotal
: Display totals for column footer in Gridview.stupant\utils\BigDataActiveDataProvider
: Gradually select data for big tables.stupant\utils\GridView
: Plain GridView table generate without any JS.Display the total of a numeric data column., (*2)
<?= GridView::widget([ 'dataProvider' => $dataProvider, 'showFooter' => true, 'footerRowOptions' => ['class' => 'text text-success bg-success'], 'columns' => [ ... [ 'attribute' => 'cnt', 'label' => Yii::t('app', 'Count'), 'format' => 'integer', 'footer' => Yii::$app->formatter->format(stupant\utils\PTotal::pageTotal($dataProvider->models, 'cnt'), 'integer') ], ... ], ]); ?>
Show a GridView without any assets bundle. Best for display data without pagination situation (export data / email templates...), (*3)
= stupant\utils\GridView::widget([ 'dataProvider' => $dataProvider, ]); ?>
Only retrieve more records if required. Suitable for big data tables., (*4)
$dataProvider = new BigDataActiveDataProvider([ 'query' => ActiveRecord::find() ]);
A set of common used yii2 tools
MIT
yii2 utils