You can create a hidden field in two ways
Method 1: inside active form
<?php $form = ActiveForm::begin() ?>
<?= $form->field($model, 'book')->hiddenInput(['data-attr' => 'any_data'])->label(false) ?>
<?= Html::submitButton('Отправить смс', ['class' => 'btn btn-success']) ?>
<?php ActiveForm::end() ?>
Method 2: with html helper
<?= Html::hiddenInput('name', $value) ?>
Comments
Post a Comment