PHP code example of baibaratsky / yii2-serialized-attributes-behavior
1. Go to this page and download the library: Download baibaratsky/yii2-serialized-attributes-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/ */
baibaratsky / yii2-serialized-attributes-behavior example snippets
public function behaviors()
{
return [
'serializedAttributes' => [
'class' => SerializedAttributes::className(),
// Define the attributes you want to be serialized
'attributes' => ['serializedData', 'moreSerializedData'],
// Enable this option if your DB is not in UTF-8
// (more info at http://www.jackreichert.com/2014/02/02/handling-a-php-unserialize-offset-error/)
// 'encode' => true,
],
];
}