PHP code example of sensetivity / yii2-changelog-behavior
1. Go to this page and download the library: Download sensetivity/yii2-changelog-behavior 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/ */
sensetivity / yii2-changelog-behavior example snippets
public function behaviors()
{
return [
...
[
'class' => Sensetivity\ChangeLog\ChangeLogBehavior::class,
'excludedAttributes' => ['updated_at', 'created_at'],
],
...
];
}
/**
* @propertu int id
* @property int created_at
* @property int updated_at
* @property string title
* @property int rating
*/
class Post extends yii\db\ActiveRecord {
/**
* @inheritdoc
*/
public function behaviors()
{
return [
[
'class' => Sensetivity\ChangeLog\ChangeLogBehavior::class,
'excludedAttributes' => ['created_at','updated_at'],
]
];
}
}