Передача атрибута в конфиг поведения модели?
Добавлено: 2018.12.09, 06:02
Всем привет. Возможно ли передать атрибут модели в конфиге поведения?
Код: Выделить всё
public function behaviors()
{
Yii::info($this); // ?
return [
'upload' => [
'class' => UploadBehavior::className(),
'file1' => [
'uploadPath' => $this->parent.'/name', // this parent null
],
'file2' => [
'uploadPath' => 'images/'.$this->relation->attr.'/another', // this relaion null
]
],