walkboy / yii2-filterform
Yii2 form style filter
Package info
github.com/wa1kb0y/yii2-filterform
Type:yii2-extension
pkg:composer/walkboy/yii2-filterform
0.1
2019-02-08 18:01 UTC
Requires
- php: >=5.6.0
This package is auto-updated.
Last update: 2026-02-19 13:09:18 UTC
README
Add "walkboy/yii2-filterform": "dev-master" to composer.json and run composer update
Usage
_filters.php
use walkboy\FilterForm\FilterForm;
<?php
$form = FilterForm::begin([
'method' => 'get',
'options' => [
'class' => 'filter-form',
'data-pjax' => 1,
]
]);
echo $form->field($searchModel, 'type')->dropDownList([
'1' => 'Foo',
'2' => 'Bar',
])->label('Type');
// insert fields here
FilterForm::end();
?>
index.php
<?php Pjax::begin(); ?>
<?= $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget() ?>
<?php Pjax::end(); ?>