M
M
Mikha Pankratov2015-12-09 12:47:36
Yii
Mikha Pankratov, 2015-12-09 12:47:36

How to put checklist checked in yii2?

Good afternoon,
I have a problem with checklist
there are 2 arrays, 2 table

$mas1 = [
    0 => [
        0 => '6'
        1 => '5'
        2 => '7'
    ]
];

and the 2nd array with a reference
$mas2 = [
    0 => [
        1 => 'None'
        2 => 'sdfsdfs'
        3 => 'sdfsdf'
        4 => 'sdf'
        5 => 'fdgdfgfdg'
        6 => 'dfgdfgdfg fdgfdgd'
        7 => 'dfgfdg dfgfdgfdg'
        8 => 'sdfsdfsdf'
    ]
];

In the first array, I got id's that are checked - how do I pass them to the view so that they are checked and unchecked?
so far like this
<?=  $form->field($user_activitie, 'active_id')->inline(true)->checkboxList($mas2) ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Villarou, 2015-12-09
@VirmarY

Will it help ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question