Advertisement
famine2

View

Aug 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.13 KB | None | 0 0
  1. <?php
  2. /* @var $this yii\web\View */
  3. use yii\widgets\ActiveForm;
  4. ?>
  5.  
  6. <?php $form = ActiveForm::begin(['id' => uniqid()]); ?>
  7.  
  8. <?php $form->enableAjaxValidation = true;?>
  9.  
  10. <?= $form->field($model, 'name', [
  11.     /* Опции template, selectors, options изменены для соответствия сторонней верстке */
  12.     'template' => '
  13.       <div class="form-callback-name field half first">
  14.           {input}
  15.           {error}
  16.       </div>
  17.       ',
  18.     'selectors' => [
  19.         'container' => '.form-callback-name.field',
  20.         'input' => '.form-callback-name input',
  21.         'error' => '.form-callback-name .help-block',
  22.  
  23.     ],
  24.     'options' => [
  25.         'tag' => null, // Don't wrap with "form-group" div
  26.     ],
  27.     'inputOptions' => [
  28.         'placeholder' => 'Имя',
  29.     ]
  30. ])->textInput(['maxlength' => true]) ?>
  31.  
  32. <?= $form->field($model, 'email', [
  33.     'template' => '
  34.       <div class="form-callback-email field half">
  35.           {input}
  36.           {error}
  37.       </div>
  38.       ',
  39.     'selectors' => [
  40.         'container' => '.form-callback-email.field',
  41.         'input' => '.form-callback-email input',
  42.         'error' => '.form-callback-email .help-block',
  43.  
  44.     ],
  45.     'options' => [
  46.         'tag' => null, // Don't wrap with "form-group" div
  47.     ],
  48.     'inputOptions' => [
  49.         'placeholder' => 'E-mail',
  50.     ]
  51. ])->textInput(['maxlength' => true]) ?>
  52.  
  53. <?= $form->field($model, 'comment', [
  54.     'template' => '
  55.       <div class="form-callback-comment field">
  56.           {input}
  57.           {error}
  58.       </div>
  59.       ',
  60.     'selectors' => [
  61.         'container' => '.form-callback-comment.field',
  62.         'input' => '.form-callback-comment textarea',
  63.         'error' => '.form-callback-comment .help-block',
  64.  
  65.     ],
  66.     'options' => [
  67.         'tag' => null, // Don't wrap with "form-group" div
  68.     ],
  69.     'inputOptions' => [
  70.         'placeholder' => 'Сообщение',
  71.     ]
  72. ])->textarea(['rows' => 2]) ?>
  73.  
  74. <ul class="actions">
  75.     <li><input type="submit" value="Отправить" class="special" /></li>
  76. </ul>
  77.  
  78. <?php ActiveForm::end(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement