fbi/yii2-admin-logging

yii2的管理员操作日志扩展

1.0.2 2015-04-13 08:12 UTC

This package is not auto-updated.

Last update: 2024-04-23 06:23:59 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');

sanwkj@163.com