A simplified Yii2 module for tracking user web-based activities
The preferred way to install this module is through composer:
Either run
php composer.phar require --prefer-dist r2am9d/yii2-activity-log
or add to the require-dev section of your composer.json
file.
"r2am9d/yii2-activity-log": "*"
Once the extension is installed, simply add the lines below to your "modules" application configuration.
return [
'modules' => [
'activity-log' => [
'class' => 'r2am9d\activitylog\Module',
],
],
];
Then add these lines to your "controllerMap" application configuration.
return [
'controllerMap' => [
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'migrationNamespaces' => [
'r2am9d\activitylog\migrations',
],
],
],
];
Lastly, run the migrations.
~$ php yii migrate
Apply the custom behavior to your Controller or Model class via inherited "behaviors" function.
/**
* {@inheritdoc}
*/
public function behaviors()
{
return [
\r2am9d\activitylog\behaviors\ActivityLogBehavior::className(),
];
}
You can then access the module through the following URL:
http://localhost/path/to/index?r=activity-log
or if you have enabled pretty URLs, you may use the following URL:
http://localhost/path/to/index/activity-log