1. Go to this page and download the library: Download yarcode/yii2-eav 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/ */
yarcode / yii2-eav example snippets
/**
* @inheritdoc
*/
public function behaviors()
{
return [
[
'class' => \yarcode\eav\EavBehavior::className(),
'valueClass' => \common\models\user_profile_eav\AttributeValue::className(),
],
];
}
/**
* @return yii\db\ActiveQuery
*/
public function getEavAttributes()
{
$query = \common\models\user_profile_eav\Attribute::find();
$query->multiple = true;
return $query;
}