Answer the question
In order to leave comments, you need to log in
How to make forms in yii?
Please tell me how to implement such a layout:
from this (At the moment):
<?= $form->field($orderForm, 'isAddressesEqual')
->label($orderForm->getAttributeLabel('billingAddress'))->checkbox([
'class' => 'js-addresses-is-equal',
'data-remeber' => true,
])->label('<span class="checkbox-text">'.$orderForm->getAttributeLabel('isAddressesEqual').'</span>')?>
Answer the question
In order to leave comments, you need to log in
I think this article https://yiico.ru/blog/499-shpargalka-po-formam-act...
will help you.
You need to look towards the “template” parameter. I think this will help
<?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' => '',
],
],
]); ?>
<?= Html::activeLabel($model, 'password') ?>
<?= Html::activePasswordInput($model, 'password') ?>
<?= Html::error($model, 'password') ?>
or
<?= Html::activeLabel($model, 'username', ['label' => 'name']) ?>
<?= Html::activeTextInput($model, 'username') ?>
<div class="hint-block">Please enter your name</div>
<?= Html::error($model, 'username') ?>
The sentence cannot contain "layout" and the name of the backend php framework at the same time. What does yii have to do with it? Type it up about css and html.
If there are difficulties with the forms widget itself, then here:
https://www.yiiframework.com/doc/guide/2.0/en/inpu...
https://www.yiiframework.com/doc/api/2.0/yii -widge...
https://www.yiiframework.com/doc/api/2.0/yii-widge...
https://www.yiiframework.com/doc/guide/2.0/en/star...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question