Checkboxlist Throws "array To String Conversion"

Im tryin to create a checkBoxList which depends on model data, so i basically added this line to my view

<?php echo $form->checkBoxList($model,'name', CHtml::listData(Places::model()->findAll(),'name','name')); ?> 

and Im gettin an exception like

Array to string conversion

Due to the doc. I just have to provide an string array, so I cant figure out, whats goin on here

Thanks in advance

You need to change your code as follows:

<?php echo $form->checkBoxList($model,'name', CHtml::listData(Places::model()->findAll())); ?> 

Hope this helps!


Saurabh Dhariwal