예제 #1
0
<?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++;
예제 #2
0
    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();
    ?>
예제 #3
0
<?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'));
}