Using Yii MVC, I want to know when a user is still on my webpage, so I need to store the last time a user has been active.
Is there a hook that can update a timestamp field in the user table ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I found the answer, adding the following code in the components/Controller.php
The code, uses the
afterActionhook, so everytime a action happens, the update is triggered.