dev-master
9999999-devLogs
MIT
The Requires
by Jakharbek
by utkir
extension yii2 logs
1.0
1.0.0.0Logs
MIT
The Requires
by Jakharbek
by utkir
extension yii2 logs
Logs
Core, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist jakharbek/yii2-logs "*"
or add, (*4)
"jakharbek/yii2-logs": "*"
to the require section of your composer.json
file., (*5)
Once the extension is installed, simply use it in your code by :, (*6)
Вам нужно сделать миграцию:, (*7)
yii migrate --migrationPath=@vendor/jakharbek/yii2-logs/src/migrations
Если вы хотите применить к определёному таблицы вам нужно создать связь между ними и в той модели (ActiveRecord) таблицы, реализовать интерфейс LogInterface, (*8)
Пример 1:, (*9)
<?=\jakharbek\logs\widgets\LogWidget::widget([ 'model' => $model, 'view' => '@your/path/to/view', 'provider' => [ 'pagination' => [ 'pageSize' => 20 ] ] ])?>
view, (*10)
/** * @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); } ]);
Пример 2:, (*11)
<?=\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); } ])?>
Logs
MIT
extension yii2 logs
Logs
MIT
extension yii2 logs