title: Yii2 checkboxlist validation without model
body: <p>I have a list of checkboxes, which aren't associated with the model itself like the rest of the form:</p>
  
  <pre class="lang-php prettyprint-override"><code>echo Html::checkboxList('options', $selected_options, $options, ['class' =&gt; 'checkbox']);
  </code></pre>
  
  <p>In the model I have a following rules:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function rules() {
      return [
          ....*/
          [['options'], 'integer'],
          ['options', 'optValidation', 'on' =&gt; 'update'],
      ];
  }
  </code></pre>
  
  <p>And the following validator:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function optValidation($attribute, $params) {
      foreach ($attribute as $attr){
          if ($attr == 1) {
              $return = true;
          }
          else {
              $return = false;
          }
      }
      if (!$return) {
          $this-&gt;addError($attribute, 'At least one checkbox has to be selected!');   
      }
  }
  </code></pre>
  
  <p>Unfortunately nothing happens when submitting the form as if there are no rules for validation of the field 'options'. Where's the catch?</p>