CHtml label functions do not receive htmlOptions

Create issue
Issue #98 on hold
Former user created an issue

Hi:

In all BootInput*.php classes, you use echo $this->getLabel();

You should pass htmlOptions in this way: echo $this->getLabel($this->htmlOptions);

If not, the CHtml Yii native functions of labeling do not receive the htmlOptions in where you can put "label" => false , to avoid printing particularly any label HTML tag, respecting the label in your model.

Thank you

Comments (3)

  1. Former user Account Deleted

    Well, correction ... maybe you don't need to pass ALL the htmlOptions to the "label" function/tag (css classes can affect to (for example) uneditable inputs) ... but "label" one is very interesting:

    echo $this->getLabel(array("label"=>@$this->htmlOptions["label"]));

  2. Christoffer Niska repo owner

    I'm not sure I understand this issue. Bootstrap input classes uses their own getLabel which do respect both label options and label visibility. If you want to set label options use $htmlOptions['labelOptions'].

  3. Log in to comment