yii\web\User::afterLogout PHP Method

afterLogout() protected method

The default implementation will trigger the [[EVENT_AFTER_LOGOUT]] event. If you override this method, make sure you call the parent implementation so that the event is triggered.
protected afterLogout ( yii\web\IdentityInterface $identity )
$identity yii\web\IdentityInterface the user identity information
    protected function afterLogout($identity)
    {
        $this->trigger(self::EVENT_AFTER_LOGOUT, new UserEvent(['identity' => $identity]));
    }

Usage Example

Example #1
1
 /**
  * @inheritdoc
  */
 public function afterLogout($identity)
 {
     parent::afterLogout($identity);
     // обновляем время авторизации и статус online
     if ($identity && $identity instanceof \nepster\users\models\User) {
         $identity->time_activity = time();
         $identity->save(false);
     }
 }
All Usage Examples Of yii\web\User::afterLogout