fbi / yii2-admin-logging
yii2的管理员操作日志扩展
1.0.2
2015-04-13 08:12 UTC
Requires
- fbi/yii2-helpers: *
- yiisoft/yii2: ~2.0
This package is not auto-updated.
Last update: 2025-02-25 09:56:16 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require fbi/yii2-admin-logging "*"
for dev-master
php composer.phar require fbi/yii2-admin-logging "dev-master"
or add
"fbi/yii2-admin-logging": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply modify your application configuration as follows:
return [
'components' => [
....
'user' => [
'class'=>'fbi\adminLogging\components\User',
....
]
....
'request' => [
'class'=>'fbi\adminLogging\components\Request',
],
];
and change your backend contorllers like follows:
....
use fbi\adminLogging\controllers\Controller;//this line
....
class SiteController extends Controller{
...
}
and if you want to log something in the application:
Yii::$app->user->log('mixed variable,anything you want to log');