YII2 Common
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yii2x/yii2-common "*"
or add
"yii2x/yii2-common": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
public function behaviors()
{
return [
[
'class' => \yii2x\common\behaviors\IpAddressBlameableBehavior::className(),
'createdIpAttribute' => 'created_ip',
'updatedIpAttribute' => 'updated_ip',
],
[
'class' => \yii2x\common\behaviors\JsonFieldBehavior::className(),
'attributes' => ['params']
]
];
}