/** * Детальная страница фотогалереи * @param string $code символьный код фотогалереи * @return string * @throws NotFoundHttpException */ public function actionDetail($code) { $model = Gallery::find()->published()->andWhere(["code" => $code])->one(); if (!$model) { throw new NotFoundHttpException("Gallery with code '{$code}' not found"); } $this->view->title = $model->title; $this->view->addBreadCrumbs([["label" => Yii::t('photogallery/app', 'Photogallery'), "url" => Url::toRoute(["/photogallery/default/index"])], ["label" => $model->title]]); return $this->render("detail", ["model" => $model]); }