PHP code example of pvsaintpe / yii2-log

1. Go to this page and download the library: Download pvsaintpe/yii2-log library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pvsaintpe / yii2-log example snippets


/**
 * @return bool
 */
public static function logEnabled()
{
    return true;
}

// backend/configs/main.php
return [
    'modules' => [
        'changelog' => [
            'class' => 'pvsaintpe\log\Module',
        ],
    ]
];

// common/configs/params.php
return [
    'changelog.configs' => [
        'db' => 'dbLog', // DB Storage for Log-tables
        'storageDb' => 'db', // DB Storage for Data-tables
        'adminTable' => 'admin', // Table Name for Admin's
        'tablePrefix' => '_log',
        'adminColumn => 'updated_by',
    ],
];
BASH
#!/usr/bin/env bash
php ./yii changelog/generate
php ./yii changelog/migrate --interactive=0