/** * Renvoie une instance du modèle identifiée par sa clé primaire. * Si cette clé ne correspond à aucun objet, une erreur 404 est lancée. * * @param string $id * @return WebTag * @throws NotFoundHttpException */ protected function findModel($id) { if (($model = WebTag::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException('Modèle introuvable : #' . $id); }
/** * @inheritdoc */ public function displayActiveFilters($sep = ' - ') { $filters = []; if ($this->title) { $filters[] = Yii::t('labels', '(title)') . ' ' . $this->title; } if ($this->body) { $filters[] = Yii::t('labels', '(text)') . ' ' . $this->body; } if ($this->tagId) { /** @var WebTag $tag */ $tag = WebTag::findOne($this->tagId); $filters[] = $tag ? $tag->label : '???'; } return implode($sep, $filters); }