Why on the category page is not displayed linked content?

Trying to make the output of products on the category page but receive the error
Trying to get property of non-object
swears on a line <?= $model--->designer->brand_name ?>

Deduce using listView
<?= ListView::widget([
 'dataProvider' =--> $dataProvider,
 'itemView' => '_view',
 'itemOptions' => ['class' => 'item'],
 'viewParams' => ['testParam' => 'designer.brand_name'],
 'layout' => "{items}\n{pager}",
]); ?>


Vyuha:
<div class="col-md-4 col-sm-6 col-xs-12 productItem">

 <a href="<?= Url::toRoute(['shop/view', 'id'=>$model->id]); ?>">

 <div class="productItem_image-container" style="background-image: url('<?= $imgs[0]->getUrl('300x400'); ?>')">
 <?php if (isset($imgs[1])): ?>
 <img class="productItem-image" src="<?= $imgs[1]->getUrl('300x400'); ?>" alt>
 <?php else: ?>
 <img class="productItem-image" src="<?= $imgs[0]->getUrl('300x400'); ?>" alt>
 <?php endif; ?>
 <?= $model--->new ? '<p class="newLabel">new</p>' : "?>
 <?= $model--->sale ? '<p class="saleLabel">sale</p>' : "?>

</div>

 <span class="productItem_text">
 <p class="productItem_text-title">
 <?= Html::encode($model--->title) ?>
</p>
 <p class="productItem_text-brand">
 <?= $model--->designer->brand_name ?>
</p>
 <p class="productItem_text-price">
 $ <?= Html::encode($model--->price) ?>
</p>
</span>

</a>

 <?= WishlistButton::widget([
 'model' =--> $model, // model to add
 'anchorActive' => '<i class="fas fa-heart"></i>', // your text active button
 'anchorUnactive' => '<i class="far fa-heart"></i>', // your text of inactive buttons
 'htmlTag' => 'a', // tag
 'cssClass' => 'wish', // your class
 'cssClassInList' => 'active' // the class added object
 ]) ?>

</div>


In the controller:
public function actionCategory($id)
{
 $searchModel = new ProductSearch();
 $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
 $categories = Category::find()->asArray()->indexBy('id')->all();

 return $this->render('category', [
 'dataProvider' => $dataProvider,
 'searchModel' => $searchModel,
 'categories' => $categories
]);
 }


In the model categories:
public function getProducts()
{
 return $this->hasMany(Product::className(), ['category_id' => 'id']);
 }


The relationship with table designers in the products table
public function getDesigner()
{
 return $this->hasOne(Designer::className(), ['id' => 'designer_id']);
 }


In other places it is tightened, the designer, and in the category - no.
Search models have with('products') to search the product model is with(['category', 'designer'])

How to make designer object everywhere?
June 7th 19 at 15:46
1 answer
June 7th 19 at 15:48
Solution
All was resolved by the replacement code for <?= $model--->designer['brand_name'] ?>
Most interesting is that the output of this line in this project has varied from <?= $model--->designer['brand_name'] ?> on <?= $model--->designer->brand_name ?> and back a few times...
We have to understand why?

Find more questions by tags Yii