review.php 1.51 KB
<?php
    /**
     * @var View $this
     * @var User $company
     */

    use common\models\User;
    use yii\web\View;

    $this->params[ 'company' ] = $company;
    $this->title = 'My Yii Application';
?>
<div class="performer-vacancy-vacant-title-reclam-wr style">
    <?php
        echo \common\modules\comment\widgets\CommentWidget::widget([
            'context'       => $this,
            'model'         => $company->className(),
            'model_id'      => $company->id,
            'comment_class' => \common\modules\comment\models\Comment::className(),
            'rating_class'  => \common\modules\comment\models\Rating::className(),
            'template' => ($company->id == \Yii::$app->user->id)?"{success}\n{list}":"{success}\n{form}\n{list}",
            'class_options' => [
                'scenario'     => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST,
                'user_id'      => \Yii::$app->user->getId(),
                'guestComment' => false,
                'status'       => \common\modules\comment\models\Comment::STATUS_ACTIVE,
            ],
            'list_options'  => [
                'view' => 'list-comment-review',
            ],
            'form_options'  => [
                'view' => 'form-comment-review',
                'tag'  => 'span',
            ],
            'options'       => [
                'class' => 'proektant-comments-wr style',
            ],
        ]);
    ?>
</div>