PHP code example of jakharbek / yii2-logs

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

    

jakharbek / yii2-logs example snippets


yii migrate --migrationPath=@vendor/jakharbek/yii2-logs/src/migrations

 <?=\jakharbek\logs\widgets\LogWidget::widget([
           'model' => $model,
            'view' => '@your/path/to/view',
            'provider' => [
                    'pagination' => [
                            'pageSize' => 20
                    ]
            ]
    ])


/**
 * @var \jakharbek\logs\models\Logs $log
 * @var \yii\db\ActiveRecord $model
 * @var \yii\data\BaseDataProvider $provider
 */
 
echo ListView::widget([
        'dataProvider' => $provider,
        'itemOptions' => ['class' => 'item'],
        'itemView' => function ($log, $key, $index, $widget) use ($model) {
                return $log->render($model);
        }
    ]);


 <?=\jakharbek\logs\widgets\LogListWidget::widget([
           'model' => $model,
            'provider' => [
                    'pagination' => [
                            'pageSize' => 20
                    ]
            ],
            'itemOptions' => ['class' => 'item'],
            'itemView' => function ($log, $key, $index, $widget) use ($model) {
                return $log->render($model);
            }
    ])

php composer.phar