atans / yii2-history
An active record history for yii2
Installs: 1 147
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-12-13 23:54:23 UTC
README
An active record history extension for yii2
Installation
1.Download
The preferred way to install this extension is through composer.
Either run
composer require atans/yii2-history
or add
"atans/yii2-history": "*"
to the require section of your composer.json
file.
Then run
composer update
2.Update database schema
$ php yii migrate/up --migrationPath=@vendor/atans/yii2-history/migrations
Usage
namespace frontend\models\User; class User extends \yii\db\ActiveRecord { /** * @inheritdoc */ public function behaviors() { return [ 'history' => [ 'class' => \atans\history\behaviors\HistoryBehavior::className(), // Options 'allowEvents' => [..], 'ignoreFields' => [...], 'extraFields' => [...], 'debug' => true, // Show the errors ], ]; } }