form-comment-review.php 2.03 KB
<?php
    /**
     * @var \common\modules\comment\models\Comment     $model
     * @var \common\models\User                        $user
     * @var \yii\data\ActiveDataProvider               $dataProvider
     * @var null|\common\modules\comment\models\Rating $rating
     */
    use yii\widgets\ActiveForm;
    use yii\helpers\Html;

?>
<div class="workplace-title style">
    <p></p>Мнения о пользователе: <?= $dataProvider->totalCount ?></p></div>
<div class="new-portf-add-comm style">
    <?php
        $form = ActiveForm::begin();
        echo $form->field($rating, 'value')
                  ->label(false)
                  ->radioList([
                      1 => 1,
                      2 => 2,
                      3 => 3,
                      4 => 4,
                      5 => 5,
                  ]);
        if($model->scenario == $model::SCENARIO_GUEST) {
            echo $form->field($model, 'user_name', [
                'options'      => [
                    'class' => 'input-blocks-comm',
                ],
                'inputOptions' => [
                    'class' => 'custom-input-4',
                ],
            ])
                      ->textInput();
            echo $form->field($model, 'user_email', [
                'options'      => [
                    'class' => 'input-blocks-comm',
                ],
                'inputOptions' => [
                    'class' => 'custom-input-4',
                ],
            ])
                      ->textInput();
        }

    ?>
    <div class="artbox_comment_reply_block"></div>
    <?php
        echo $form->field($model, 'text', [
            'options'      => [
                'class' => 'input-blocks-comm area-comm',
            ],
            'inputOptions' => [
                'class' => 'custom-area-4',
            ],
        ])
                  ->textarea();
    ?>
    <div class="input-blocks-comm-button style">
        <?= Html::submitButton('Добавить комментарий') ?>
    </div>
    <?php
        $form->end();
    ?>
</div>