Issue #80 resolved

Labels in BootActiveForm

Jarosław Borowski
created an issue

You can't set htmlOptions for labels in BootActiveForm. Possible solution:

in BootInput {{{


protected function getLabel($htmlOptions = array()) { if (isset($this->htmlOptions['labelOptions']) && is_array($this->htmlOptions['labelOptions'])) { $labelOptions = $this->htmlOptions['labelOptions']; unset($this->htmlOptions['labelOptions']); return $this->form->labelEx($this->model, $this->attribute, $labelOptions); } else if ($this->label !== false && !in_array($this->type, array('checkbox', 'radio')) && $this->hasModel()) return $this->form->labelEx($this->model, $this->attribute, $htmlOptions); else if ($this->label !== null) return $this->label; else return ''; } }}}

usage: {{{


echo $form->textFieldRow($model,"text",array('class'=>'span5', 'labelOptions'=>array('label'=>'new label', 'class'=>'test'))); }}}

Comments (3)

  1. Anonymous

    Hallo Christoffer,

    it does not work for a checkBoxRow. Please support that as well!

    Best regards,


  2. Log in to comment