use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin([
'layout'=>'horizontal',
'options' => ['class' => 'signup-form form-register1'],
'fieldConfig' => [
'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
'horizontalCssClasses' => [
'label' => 'col-sm-4',
'offset' => 'col-sm-offset-4',
'wrapper' => 'col-sm-8',
'error' => '',
'hint' => '',
],
],
]); ?>
$form = ActiveForm::begin([
'id' => 'blog-form',
'options' => [
'enctype' => 'multipart/form-data'
]
]);
<?= $form->field($model, 'text', ['template' => "{label}\n{hint}\n{input}\n{error}"])
->hint('подсказка для поля text')
->widget(Widget::classname(), [
'settings' => [
'lang' => 'ru',
'removeWithoutAttr' => [],
'minHeight' => 300,
'pastePlainText' => true,
'buttonSource' => true,
'replaceDivs' => false,
'plugins' => [
'clips',
'fullscreen',
'fontfamily',
'fontsize',
'fontcolor',
'video',
'table'
],
'imageUpload' => Url::to(['/blog/image-upload']),
'imageManagerJson' => Url::to(['/blog/images-get']),
'fileManagerJson' => Url::to(['/blog/files-get']),
'fileUpload' => Url::to(['/blog/file-upload'])
]
]); ?>
<?php $form = ActiveForm::begin([
'id' => 'contact-form',
'options' => ['class' => 'form2 form-register1'],
'fieldConfig' => ['template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}"]
]); ?>
<?= $form->field($model, 'name', ['enableLabel' => false])->textInput(array('placeholder' => 'Ваше имя', 'class' => 'form-control text-center')); ?>
<?= $form->field($model, 'email', ['enableLabel' => false])->textInput(array('placeholder' => 'Ваше email', 'class' => 'form-control text-center')); ?>
<?= $form->field($model, 'phone', ['enableLabel' => false])->textInput(array('placeholder' => 'Номер Вашего телефона', 'class' => 'form-control text-center')); ?>
<?= $form->field($model, 'message', [
'template' => '{label}{input}{hint}{error}'
])->textArea(['rows' => 6, 'enableLabel' => true])->label('Ваши пожелания'); ?>
<div class="form-group">
<?= Html::submitButton('<img src="/images/send.png" />', [
'class' => 'form2 button_zvon uppercase',
'name' => 'contact-button'
]) ?>
</div>
<?php ActiveForm::end(); ?>
Yii2
PHPYii