I am want to get relational table field value in View,But the relational table maybe have not corresponding data.Can I use some method to replace the php code in Yii2 View?
// $model->relationTable maybe is null
<?= isset($model->relationalTable)?$model->relationalTable->field:'' ?>
I hope $model->relationalTable->field
can work when $model->relationalTable
is null.I wantn't a lot of if condition
in view.