本文整理匯總了PHP中common\models\Comment::getCommentsBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP Comment::getCommentsBlock方法的具體用法?PHP Comment::getCommentsBlock怎麽用?PHP Comment::getCommentsBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類common\models\Comment
的用法示例。
在下文中一共展示了Comment::getCommentsBlock方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionPhoto
/**
* Url: /album/{$album_id}-{$slug}/{$photo_id}
* @param int $album_id Album id
* @param string $slug Album slug
* @param $photo_id
* @return mixed Content
* @throws NotFoundHttpException
*/
public function actionPhoto($album_id, $slug, $photo_id)
{
$album = Album::find()->where(['id' => $album_id, 'is_public' => 1])->one();
if (!isset($album)) {
throw new NotFoundHttpException('Страница не найдена.');
}
$photo = Asset::find()->where(['id' => $photo_id, 'thumbnail' => Asset::THUMBNAIL_CONTENT])->one();
if (!isset($photo)) {
$photo = Asset::find()->where(['id' => $photo_id])->one();
}
if (!isset($photo)) {
throw new NotFoundHttpException('Страница не найдена.');
}
return $this->render('@frontend/views/site/index', ['templateType' => 'col2', 'title' => 'Dynamomania.com | Фотоальбом: ' . $album->title, 'columnFirst' => ['content' => ['view' => '@frontend/views/site/photo_single', 'data' => compact('album', 'photo')], 'comments' => Comment::getCommentsBlock($photo->id, Comment::COMMENTABLE_PHOTO)], 'columnSecond' => ['short_news' => SiteBlock::getshortNews(50)]]);
}