1. Go to this page and download the library: Download sateler/yii2-changelog 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/ */
public function behaviors()
{
return [
[
'class' => \sateler\changelog\ChangeLogBehavior::className(),
'ignore' => [], // ignore changes on listed columns
],
...
];
}
return [
'controllerMap' => [
'changelog' => [
'class' => 'sateler\changelog\controllers\ChangelogController',
'viewPath' => '@vendor/sateler/yii2-changelog/views/changelog',
// Optional: if set, it's used in the views to create the html link for the record.
'urlCreator' => function ($table_name, $row_id) {
$table_name = \yii\helpers\Html::encode(str_replace('_', '-', $table_name));
return yii\helpers\Url::to(["$table_name/view", 'id' => $row_id]);
},
]
],
];
php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.