2017 © Pedro Peláez
 

yii2-extension yii2-auditlog

Yii2 Audit Log. This extension log all models actions -> find/insert/update/delete.

image

lisi4ok/yii2-auditlog

Yii2 Audit Log. This extension log all models actions -> find/insert/update/delete.

  • Monday, November 9, 2015
  • by lisi4ok
  • Repository
  • 1 Watchers
  • 2 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 17 % Grown

The README.md

Yii2 Audit Log

Yii2 Audit Log. This extension log all models actions -> find/insert/update/delete., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist lisi4ok/yii2-auditlog "*"

or add, (*4)

"lisi4ok/yii2-auditlog": "*"

to the require section of your composer.json file., (*5)

Go to yii app folder. and type:, (*6)

./yii migrate --migrationPath=@vendor/lisi4ok/yii2-auditlog/migrations

Usage

<?php
namespace app\models;
use Yii;
use lisi4ok\auditlog\behaviors\LoggableBehavior;

class MyModel extends \yii\db\ActiveRecord
{
    public function behaviors() {
        return [
            [
                'class' => LoggableBehavior::className(),
                'ignoredAttributes' => ['created_at', 'updated_at', 'created_by', 'updated_by'], // default []
                'ignorePrimaryKey' => true, // default false
                'ignorePrimaryKeyForActions' => ['insert', 'update'], //default [] Note: (if ignorePrimaryKey set to true, ignorePrimaryKeyForActions is empty will apply for all)
                'dateTimeFormat' => 'Y-m-d H:i:s', // default 'Y-m-d H:i:s'
            ],
        ];
    }
}

The Versions

09/11 2015

dev-master

9999999-dev

Yii2 Audit Log. This extension log all models actions -> find/insert/update/delete.

  Sources   Download

BSD-3-Clause

The Requires

 

by Nikola Haralamov

extension yii2