nullref / yii2-useful
Useful things for Yii2
Installs: 8 158
Dependents: 13
Suggesters: 0
Security: 0
Stars: 7
Watchers: 6
Forks: 1
Type:yii2-extension
pkg:composer/nullref/yii2-useful
Requires
- php: >=5.4.0
- yiisoft/yii2: >=2.0.6
This package is auto-updated.
Last update: 2025-10-04 10:12:17 UTC
README
Collection helpful classes for Yii2
Installation
composer require nullref/yii2-useful --prefer-dist
Structure
Actions
- 
EditActionAction for AJAX model update. 
- 
MultipleDeleteActionAllows to delete multiple models. 
- 
MultipleUpdateActionAllows to update multiple models. 
Behaviors
- 
BinaryBehaviorAllows encode and decode model fields as integer number. 
- 
DateBehaviorAllows encode and decode model fields as Unix timestamp. 
- 
JsonBehaviorAllows encode and decode model fields as JSON. 
- 
RelatedBehaviorAllows to load related data for model. 
- 
SerializeBehaviorAllows encode and decode model fields as serialize php string. 
- 
TranslationBehaviorAllows to implement multilingual features. 
- 
CacheTagDependencyBehaviorAllows to invalidate TagDependency when modify ActiveRecord 
Traits
- 
GetDefinitionAllows to get defined in DI container class or default. 
- 
HasPasswordAllows to set and validate password for model. 
- 
MappableAllows to get map from ActiveRecord. 
- 
MappableQuerySame as Mappable trait but for ActiveQuery. 
- 
SessionModelSave and get object from session 
Filters
Helpers
Old version
(Will be remove from version 1.0.0)
JSONBehavior
Allows save in text field customs data structure.
ArrayBehavior
Allows save in text field array structure.
BitBehavior
Allows save in integer field bit array.
DropDownTrait
Allows get lists from ActiveRecord.
PasswordTrait
Easy work with password.
EditAction
Action for AJAX record update.
MultipleUpdateAction
Action multiple update by list of IDs.
TranslationBehavior
Allows implement translations for models