Answer the question
In order to leave comments, you need to log in
At creation textInput attributes are automatically appropriated. How to fix?
Good afternoon.
Automatically assigns attributes to a text input field.
I pass two values id, form through the controller
public function actionBlock() {
$form = new BlockForm;
$id = Yii::$app->request->get();
return $this->render('block', [
'form' => $form,
'id' => $id,
]);
}
$f = ActiveForm::begin();
$f->field($form, 'reason', [
'template' => '
<div class="form-group has-feedback">
<label>Почтовый адрес</label>
{input}
<i class="icon-users form-control-feedback"></i>
{error}
</div>'
])->textInput([
'class' => 'form-control',
'placeholder' => 'Почтовый адрес'
])->label(false);
ActiveForm::end();
<input type="hidden" name="_csrf" value="VEFEVVpvMHkHJ3VkFzV6Kzt4cTwgP0lLEhEoZT47ckx5dSgmCRhKCQ==">
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question