Blame view

common/modules/comment/widgets/views/form-comment.php 1.55 KB
b82db04a   Yarik   test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  <?php
      /**
       * @var \common\modules\comment\models\Comment $model
       * @var \common\models\User                    $user
       * @var \yii\data\ActiveDataProvider           $dataProvider
       */
      use yii\widgets\ActiveForm;
      use yii\helpers\Html;
  
  ?>
  <div class="new-portf-comm-count">Комментарии: <?= $dataProvider->totalCount ?></div>
  
  <div class="new-portf-add-comm style">
      <?php
          $form = ActiveForm::begin();
      ?>
  
      <?php
          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();
          }
          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>