<?php if ($nested_level < Comments::getInstance()->maxNestedLevel) { ?> <?php if (!Comments::getInstance()->onlyRegistered || !Yii::$app->user->isGuest) { ?> <div class="reply-form<?php echo Comments::getInstance()->displayAvatar ? ' display-avatar' : ''; ?> "> <?php if ($model->id == ArrayHelper::getValue(Yii::$app->getRequest()->post(), 'Comment.parent_id')) { ?> <?php echo CommentsForm::widget(['reply_to' => $model->id]); ?> <?php } ?> </div> <?php } ?> <?php if (!empty($model->comments)) { ?> <div class="sub-comments"> <?php $nested_level++;
echo Comment::activeCount($model, $model_id); ?> )</h5> <?php $this->endCache(); ?> <?php } ?> <?php if (!Comments::getInstance()->onlyRegistered || !Yii::$app->user->isGuest) { ?> <div class="comments-main-form"> <?php echo CommentsForm::widget(); ?> </div> <?php } ?> <?php if ($this->beginCache($cacheKey, $cacheProperties)) { ?> <?php echo CommentsList::widget(compact('model', 'model_id', 'comment')); ?> <?php $this->endCache(); ?>
<?php use yeesoft\comments\Comments; use yeesoft\comments\widgets\CommentsForm; ?> <?php if (!Comments::getInstance()->onlyRegistered || !Yii::$app->user->isGuest) { ?> <?php echo CommentsForm::widget(compact('reply_to')); }