PHP code example of dbrisinajumi / audittrail

1. Go to this page and download the library: Download dbrisinajumi/audittrail 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/ */

    

dbrisinajumi / audittrail example snippets


        'audittrail' => array(//++
            'class' => 'vendor.dbrisinajumi.audittrail.AudittrailModule', 
            'ref_models' => array(
                'DtrsTruckStatus' => array(
                    'DtrcTruckContainers' => 'dtrc_dtrs_id',
                    'D2files' => array(
                        'compare' => array(
                            'model' => 'depo2.DtrsTruckStatus',
                            'model_id' => 'pk_value',
                            ),

                    ),                    
                    'yii_t_category' => 'Depo2Module.model',
                    'yii_t_message' => 'Truck',                    
                ),
                'DtrcTruckContainers' => array(
                    'yii_t_category' => 'Depo2Module.model',
                    'yii_t_message' => 'Containers',                    
                ),
                'D2files' => array(
                    'hidded_fields' => ['add_datetime','user_id','model','model_id','upload_path'],
                    'yii_t_category' => 'D2filesModule.crud_static',
                    'yii_t_message' => 'Attachments'
                ),

            'ref_field_sql' => array(
                'car_id' => 'SELECT car_reg_number v FROM cars WHERE car_id = #id#',
                'price_id' => "SELECT price from prices where id = #id#",
            ),
        ),