_form.php 2.07 KB
<?php
    use common\modules\comment\models\CommentModel;
    use common\modules\comment\models\RatingModel;
    use yii\base\Model;
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\web\View;
    use yii\widgets\ActiveForm;
    
    /**
     * @var CommentModel     $comment_model
     * @var array            $form_params
     * @var Model            $model
     * @var string           $formId
     * @var View             $this
     * @var RatingModel|NULL $rating_model
     */
    $form = ActiveForm::begin([
        'id'     => $formId,
        'action' => Url::to([
            'artbox-comment/default/create',
            'entity' => $comment_model->encryptedEntity,
        ]),
    ]);
?>
<div style="clear:both;"></div>
    <div class="otz_buttons" style="">
        <a href="#" class="btn_otz more1">Больше отзывов</a>
        <a href="#" class="btn_otz write">Написать отзыв</a>
    </div>
<div class="add_comment">
    <div class="title">Мы обязательно рассмотрим все отзывы!</div>
    <div class="close_comm"></div>
    <div class="form-comm-wr">
        <?php

            echo $form->field($comment_model, 'text', [ 'options' => [ 'class' => 'form-group input_bl area_bl' ] ])
            ->textarea([
                'placeholder' => 'Комментарий',
                'rows' => 8,
                'spellcheck' => false,
            ]);

            echo $form->field($comment_model, 'username', [ 'options' => [ 'class' => 'form-group input_bl' ] ])
                          ->textInput([
                              'placeholder' => 'Имя',
                          ]);
            
            echo $form->field($comment_model, 'email', [ 'options' => [ 'class' => 'form-group input_bl' ] ])
                          ->textInput([
                              'placeholder' => 'e-mail',
                          ]);

            echo Html::tag('div', Html::submitButton(Yii::t('artbox-comment', 'Submit')), [ 'class' => 'input_bl submit_btn' ]);
        ?>
    </div>
    </div>
<?php
    ActiveForm::end();
?>