Example #1
0
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 
} else {
    ?>
        <?php 
    TimeAgo::widget(['language' => substr(\Yii::$app->language, 0, 2)]);
    //SIMONE
    ?>
    <?php 
}
?>
</div>
Example #2
0
<?php 
if ($nested_level < Comments::getInstance()->maxNestedLevel) {
    ?>
    <?php 
    if (!Comments::getInstance()->onlyRegistered || !Yii::$app->user->isGuest) {
        ?>
        <div class="reply-form">
            <?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 ($model->isReplied()) {
        echo CommentsList::widget(ArrayHelper::merge(CommentsHelper::getReplyConfig($model), ["comment" => $comment, "nested_level" => $nested_level + 1]));
    }
}
?>