sangroya / yii2-listview
Enhanced the ListView widget of yii2 framework to add header and maintain order of layout tags
Installs: 2 209
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2025-04-18 22:02:27 UTC
README
Enhanced the ListView widget of yii2 framework using bootstrap classes
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist sangroya/yii2-listview "*"
or add
"sangroya/yii2-listview": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \sangroya\ListView::widget([ 'dataProvider' => $dataProvider, 'options' => [ 'tag' => 'table', 'class' => 'importview-table table-bordered', 'id' => 'list-wrapper', ], 'layout' => "{summary}\n{items}\n{pager}", 'itemOptions' => ['class' => 'item', 'style' => 'margin-bottom: 5px;', 'tag'=>'tr'], 'itemView' => function ($model, $key, $index, $widget) use($errors, $table_columns,$status){ return $this->render('_list_item',['model' => $model]); }, ]) ?>