walkboy/yii2-filterform

Yii2 form style filter

Installs: 2 191

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

0.1 2019-02-08 18:01 UTC

This package is auto-updated.

Last update: 2024-05-19 09:36:58 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(); ?>