t-kanstantsin / yii2-author-behavior
Author behavior for Yii 2 framework.
Installs: 114
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Type:yii2-extension
Requires
- php: >=5.5.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-12-21 20:52:03 UTC
README
Behavior represents additional functionality similar to yii\db\TimestampBehavior
but automatically fills the specified attributes with the current user id
or value defined in value
field.
Install
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require --prefer-dist t-kanstantsin/yii2-author-behavior "*"
or add
"t-kanstantsin/yii2-author-behavior": "*"
to the require section of your composer.json
file.
Usage
Example behavior configuration:
// in `behaviors` method [ 'class' => tkanstantsin\yii2\behaviors\AuthorBehavior::class, 'createdByAttribute' => 'created_by_id', 'updatedByAttribute' => 'updated_by_id', ],
Credits
License
The BSD License (BSD). Please see License File for more information.