S
S
Sergey2015-04-20 15:20:27
Yii
Sergey, 2015-04-20 15:20:27

How to set hidden input value in yii2 using ActiveForm?

In general, I need to set different hiddenInput values ​​for different operations.
How to do it?
The code is something like this:

<? echo $form->field($model1, 'operation')->hiddenInput(); ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2015-04-20
@butteff

<? echo $form->field($model1, 'operation')->hiddenInput(['value' => 'hidden value']); ?>

B
bzz, 2015-04-20
@bzz

<?= Html::hiddenInput('Model[field]', $value) ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question