Hi, I want to track what the users did in the system.
So I write this in my controller:
protected function beforeAction($action) {
//......
if (!Yii::app()->user->isGuest) {
$monitor = new Monitor;
$monitor->user_id = Yii::app()->user->id;
$monitor->controllor = $this->id;
$monitor->action = $action->id;
$monitor->create_at = date('Y-m-d H:i:s', time());
$monitor->save();
}
return true;
//......
}
In this way, I can store info about controller and action, but this is not enough. I also need to store params from request of post and get and other params, for instance:
http://127.0.0.1/pro/index.php/concept/24
//how to get '24'?
//.......
$.ajax({
//.......
data: {id: id},
//.......
});
//.......
//how to get 'id'?