Yii Framework Forum: Checkboxlist Issue - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Checkboxlist Issue Rate Topic: -----

#1 User is offline   arch649 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 21-August 14

Posted 21 August 2014 - 02:02 PM

Hello,

I'm very new to Yii and I'm having problems with a contact form I need to add check boxes to.

<div>
<?php echo CHtml::activeLabel($model, Yii::t('Company', 'Modules'), array('class' => 'control-label', 'required' => false)); ?>
   <div>
     <?php
       echo CHtml::checkBoxList($model, 'modules' ,array(
         '0'=>'Mod1',
	 '1'=>'Mod2',
	 '2'=>'Mod3',
	 '3'=>'Mod4',
	 '4'=>'Mod5'
      ));
     ?>
   </div>
</div>


I have a feeling this is just some kind of syntax error. Like I said, I'm new to the Yii framework so this may be a dumb question.

Thanks,
0

#2 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 22 August 2014 - 09:34 PM

You probably want to use activeCheckBoxList : http://www.yiiframew...kBoxList-detail
0

#3 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 22 August 2014 - 09:36 PM

BTW, you probably would like to use activeLabelEx as well.
And welcome to the forum!
0

#4 User is offline   DaisyOntas 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 16-August 14

Posted 09 September 2014 - 03:04 AM

@yugene Thanks i am also facing this problem thank you for the checkboxlist solution.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users