title: How to have Yii2.0 CheckboxList items as checked as the form loads?
body: <p>I am trying to use a Activeform checkboxlist widget in YII 2.0 Framework</p>
  
  <p>in my case, i have an array called "list" which has the names of languages which will be rendered out as checkboxlist, now i am able to do that, but i want the check boxes to be checked as the form loads.</p>
  
  <pre><code>$list = [0 =&gt; 'PHP', 1 =&gt; 'MySQL', 2 =&gt; 'Javascript'];
  $list2 = [0,2];
  </code></pre>
  
  <p>using the following line, i am able to acheive what i want using HTML helper classes :</p>
  
  <pre><code>&lt;?= Html::checkboxList('CuisineId',$list2,$list); ?&gt;
  </code></pre>
  
  <p>but i want to be able to do this using the Activeform Widget CheckboxList, which as per <a href="http://www.yiiframework.com/doc-2.0/yii-widgets-activefield.html#checkboxList%28%29-detail" rel="noreferrer">documentation</a> is to be used in the following way :</p>
  
  <blockquote>
    <p>static checkboxList( $items, $options = [] )</p>
  </blockquote>
  
  <p>So in my case, i have figured how to pass the parameter for $items, which is in the following way:</p>
  
  <pre><code>&lt;?= $form-&gt;field($record, 'CuisineId')-&gt;checkboxlist($list);?&gt; 
  </code></pre>
  
  <p>But now i do not know how to pass the parameters that will allow the checkboxes to be checked.</p>