A
A
Alexander Gorkin2018-08-06 22:20:54
Yii
Alexander Gorkin, 2018-08-06 22:20:54

How to assign checked to radio?

How to assign checked to one of the radio?

<?php $form = ActiveForm::begin() ?>
               <?= $form->field($orders,'status')->radio(['value' => '0'] )->label('Физическое лицо');?>
            </div>
            <div class="col-md-6">
              <?= $form->field($orders,'status')->radio(['value' => '1'])->label('Юридическое лицо');?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-08-06
@sidni

<?php
$orders->status = '1';
$form->field($orders, 'status')->radioList([
    '0' => 'Физическое лицо',
    '1' => 'Юридическое лицо',
]);
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question