https://github.com/NullRefExcep/yii2-useful
Yii 2 behaviors, traits and other useful stuff
https://github.com/NullRefExcep/yii2-useful
php yii2 yii2-extension
Last synced: 11 days ago
JSON representation
Yii 2 behaviors, traits and other useful stuff
- Host: GitHub
- URL: https://github.com/NullRefExcep/yii2-useful
- Owner: NullRefExcep
- Created: 2014-09-24T00:11:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-05-03T22:14:19.000Z (about 5 years ago)
- Last Synced: 2025-04-12T22:55:07.919Z (about 1 month ago)
- Topics: php, yii2, yii2-extension
- Language: PHP
- Homepage:
- Size: 41 KB
- Stars: 6
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Yii2-useful
=====================
[](https://packagist.org/packages/nullref/yii2-useful) [](https://packagist.org/packages/nullref/yii2-useful) [](https://packagist.org/packages/nullref/yii2-useful) [](https://packagist.org/packages/nullref/yii2-useful)Collection helpful classes for Yii2
## Installation
```bash
composer require nullref/yii2-useful --prefer-dist
```## Structure
### Actions
- #### EditAction
Action for AJAX model update.- #### MultipleDeleteAction
Allows to delete multiple models.- #### MultipleUpdateAction
Allows to update multiple models.### Behaviors
- #### BinaryBehavior
Allows encode and decode model fields as integer number.- #### DateBehavior
Allows encode and decode model fields as Unix timestamp.- #### JsonBehavior
Allows encode and decode model fields as JSON.
- #### RelatedBehavior
Allows to load related data for model.
- #### SerializeBehavior
Allows encode and decode model fields as serialize php string.
- #### TranslationBehavior
Allows to implement multilingual features.
- #### CacheTagDependencyBehavior
Allows to invalidate TagDependency when modify ActiveRecord
### Traits
- #### GetDefinitionAllows to get defined in DI container class or default.
- #### HasPassword
Allows to set and validate password for model.- #### Mappable
Allows to get map from ActiveRecord.
- #### MappableQuerySame as Mappable trait but for ActiveQuery.
- #### SessionModelSave and get object from session
### Filters
- #### RedirectFilter
Redirect after action by url param.### Helpers
- #### Memoize
Class for calling memoized function or method.## 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