Yii Framework Forum: Cactiveform::checkboxlist - Yii Framework Forum

Jump to content

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

Cactiveform::checkboxlist extending Rate Topic: -----

#1 User is offline   bas_vdl 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 215
  • Joined: 01-April 09

Posted 13 January 2013 - 10:57 AM

Can somebody help me with exteding the CActiveForm::checkBoxList.

Default the layout from the checkBoxList is:
<label class="checkbox">Option one is this and that—be sure to include why it's great</label>
<input type="checkbox" value="">


But im using bootstrap framework and for that you need the following structure:

<label class="checkbox">
    <input type="checkbox" value="">
    Option one is this and that—be sure to include why it's great
</label>


Thank you in advanced!
0

#2 User is offline   alirz23 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,094
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 13 January 2013 - 12:48 PM

you dont have to use CActiveForm::checkBoxList() there is CHtml::checkBoxList() make use of that


example
<?php echo CHtml::label("Option one is this and that—be sure to include why it's great<br />".CHtml::checkBoxList('fieldName', 'id', array('first', 'second')), 'fieldName'); ?>

0

#3 User is offline   bas_vdl 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 215
  • Joined: 01-April 09

Posted 14 January 2013 - 02:28 PM

View Postalirz23, on 13 January 2013 - 12:48 PM, said:

you dont have to use CActiveForm::checkBoxList() there is CHtml::checkBoxList() make use of that


example
<?php echo CHtml::label("Option one is this and that—be sure to include why it's great<br />".CHtml::checkBoxList('fieldName', 'id', array('first', 'second')), 'fieldName'); ?>



That doesn't give me de layout of a checkbox wrapped by a label
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