Answer the question
In order to leave comments, you need to log in
Yii2: Why can't I get the computed property of an ActiveRecord model?
Hello.
Communication announced:
/** @var app\models\Goods $this*/
public function getProducer()
{
return $this->hasOne(GoodProducers::className(), ['id' => 'fk_producers']);
}
/** @var app\models\Goods $model */
<?= $model->producer->name . ' ' . $model->name; ?>
/** @var app\models\Goods $this*/
public $fullName;
public function getFullName()
{
return $this->producer->name . ' ' . $this->name;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question