title: htmlspecialchars() expects parameter 1 to be string, array given in Yii 1
body: <p>I am trying to get multiple selections from user  but after submitting I get the error : </p>
  
  <p>htmlspecialchars() expects parameter 1 to be string, array given</p>
  
  <pre><code>&lt;?php echo $form-&gt;labelEx($model, 'Books_read'); ?&gt;
  &lt;div&gt;
   &lt;?php $opts = array('booka' =&gt; 'Book A', 'bookb' =&gt; 'Book  B', 'bookc' =&gt; 'Book C ', 'bookd' =&gt; 'Book D','booke' =&gt; 'Book E','bookf' =&gt; 'Book F');
      echo $form-&gt;checkBoxList($model, 'Books_read', $opts, array(
                    'class' =&gt; 'checkbox',
                  'multipe' =&gt; 'multiple',
                'template' =&gt; '{input}{label}',
                 'separator' =&gt; '&lt;br/&gt;',
                'labelOptions' =&gt; array('style' =&gt;'margin: 2px 0px 2px 4px;'),
                                          'style' =&gt; 'float:left;',)); ?&gt;
  
          &lt;/div&gt;
        &lt;?php echo form-&gt;error($model,'Books_read '); ?&gt;
  &lt;div style="clear: both;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>datatype in database</strong> : text (works fine for other form)</p>
  
  <p><strong>model class :</strong> </p>
  
  <pre><code>protected function afterFind() {
  
          if ($this-&gt;isJSON($this-&gt;Books_read)) 
          {
              $this-&gt;Books_read = json_decode($this-&gt;Books_read);
          }
  
          return parent::afterFind();
      }
  </code></pre>