How to insert anchor inside checkBoxList's template in Yii

162 views Asked by At

Is any solution? I use

template'=>'<li>{input}<a href="/site/view/">{labelTitle}</li>',

how to place item ID inside href to make link like

href="/site/view/12"

Thanks in advance

1

There are 1 answers

0
Ali MasudianPour On BEST ANSWER

As checkBoxList() and activeCheckBoxList() template options are text and only accept below list:

  • {input}
  • {beginLabel}
  • {label}
  • {labelTitle}
  • {endLabel}

it is not feasible, unless you override checkBoxList() method which is a method of CHtml class.

As a suggestion, use checkBox() or activeCheckBox() and populate them in a loop.