Mark_Liu
(Mark Liu)
1
Dear All:
I have a question about how to implement the beforeLogout function.
I add this function in my user model but is not working.
I use yii2 basic template
Below is my class
class User extends ActiveRecord implements IdentityInterface
{
public function beforeLogout()
{
}
}
Please help me. Thx!!!
ramzesua
(Michaelnazaruk)
2
Hi, try using like this.
'components' => [
'user' => [
'identityClass' => 'app\models\user\User',
'enableAutoLogin' => true,
'on beforeLogout' => function($event) {
... code here ...
}
],
]
Mark_Liu
(Mark Liu)
3
Thank you!!! It’s working for me.