[ 'class' => 'yii\web\ErrorAction', ], ]; } public function getProducer() { if($this->producer) { return $this->producer ; } else { $producer = Etablissement::findOne(['slug' => Yii::$app->getRequest()->getQueryParam('slug_producer')]) ; if($producer) { $this->producer = $producer ; return $this->producer ; } else { throw new \yii\web\HttpException(404, 'Établissement introuvable'); } } } } ?>