tugmaks/yii2-lastseen Automatically fills last activity time for current user

extension

Yii2 Last Seen Behavior

Automatically fills last activity time for current user

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist tugmaks/yii2-lastseen "0.2"

or add

"tugmaks/yii2-lastseen": "0.3"

to the require section of your composer.json file.

Usage

Once the behavior is installed, simply use it in your code by adding this lines to application config:


    'as lastSeen'=>[
        'class'=>'tugmaks\behaviors\LastSeen\LastSeenBehavior',
        'lastSeenAttribute'=>'last_seen' // attribute that stores last seen time in user table
        // uncomment this line if you store last seen as datetime, by default beahavior saves as unixtime
        //'value'=> new \yii\db\Expression('NOW()'),
    ]```

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

  • 0.320 March 2017
  • 0.209 December 2016
  • 0.109 December 2016

Comments



0.3 is the latest of 3 releases



MIT license
Stats
1 github stars & 0 github forks
0 downloads in the last day
0 downloads in the last 30 days
264 total downloads