本文整理汇总了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)]]);
}