Skip to content

k-timoshenko/yii2-author-behavior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Author behavoir

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages