Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 21 | All time: 11,272 This week: 660 |
Version | License | PHP version | Categories | |||
yii2-form-prefiller 1.0 | MIT/X Consortium ... | 5 | PHP 5, User Management |
Remember user-filled form data, prefill forms with remembered data Usefully for remember filter/sorting preferences, or make some sticky attributes
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist insolita/yii2-form-prefiller "~1.0"
or add
"insolita/yii2-form-prefiller": "~0.0.1"
to the require section of your composer.json
file.
Once the extension is installed, configure component :
'components'=>[
'prefiller' => [
'class' => \insolita\prefiller\FormPrefiller::class,
'storage' => [
//one of storage types - db,session,cookie,redis supported
'class' => \insolita\prefiller\storages\CookieStorage::class,
],
],
]
Support ActiveRecord models,yii\base\Model,DummyModel
Remember $model data in storage
Yii::$app->prefiller->persist($model, new PrefillConfig([]));
Fill $model from storage
Yii::$app->prefiller->fillFromStorage($model, new PrefillConfig([
'skipFromStorageAttributes'=>['someAttr'],
'validateStorage'=>false
]));
Fill model from request->fillFromStorage->fillDefaults->persist if request update model
$filter = new DummyModel(['page','sort','sortOrder','searchQuery','viewMode']);
Yii::$app->prefiller->fill($filter, new PrefillConfig([
'method'=>'get',
'defaults'=>['sort'=>'price','sortOrder'=>'desc','viewMode'=>'grid']
'skipFromRequestAttributes'=>['searchQuery'],
'validateRequest'=>true
]));
Files (27) |
File | Role | Description | ||
---|---|---|---|---|
src (3 files, 2 directories) | ||||
tests (4 files, 2 directories) | ||||
.scrutinizer.yml | Data | Auxiliary data | ||
.travis.yml | Data | Auxiliary data | ||
CHANGELOG.md | Data | Auxiliary data | ||
codeception.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files (27) | / | src |
File | Role | Description | ||
---|---|---|---|---|
contracts (3 files) | ||||
storages (6 files) | ||||
BasePrefiller.php | Class | Class source | ||
FormPrefiller.php | Class | Class source | ||
PrefillConfig.php | Class | Class source |
Files (27) | / | src | / | contracts |
File | Role | Description |
---|---|---|
IFormPrefiller.php | Class | Class source |
IMemorableForm.php | Class | Class source |
IPrefillStorage.php | Class | Class source |
Files (27) | / | src | / | storages |
File | Role | Description |
---|---|---|
BaseStorage.php | Class | Class source |
CookieStorage.php | Class | Class source |
DbStorage.php | Class | Class source |
RedisHashStorage.php | Class | Class source |
RedisStorage.php | Class | Class source |
SessionStorage.php | Class | Class source |
Files (27) | / | tests |
File | Role | Description | ||
---|---|---|---|---|
config (2 files) | ||||
unit (3 files) | ||||
.env | Data | Auxiliary data | ||
bootstrap.php | Example | Example script | ||
unit.suite.yml | Data | Auxiliary data | ||
yii | Example | Example script |
Files (27) | / | tests | / | config |
File | Role | Description |
---|---|---|
base.php | Class | Class source |
console.php | Class | Class source |
Files (27) | / | tests | / | unit |
File | Role | Description |
---|---|---|
bootstrap.php | Aux. | Auxiliary script |
DummyModel.php | Class | Class source |
FormPrefillerTest.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
yii2-form-prefiller-2022-10-10.zip 16KB | |
yii2-form-prefiller-2022-10-10.tar.gz 10KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.