I’m using textFieldRow function from TbActiveForm from Yii-Bootstrap / Yii-Booster extension and either I’m missing something or there is a bug with htmlOptions[‘label’] (third parameter).
You can set it to FALSE, to hide text field’s label, but you can’t modify label’s value. No matter, what value you pass to [size=“2”]htmlOptions[‘label’][/size][size=“2”] (null, empty string, non-empty string) it is always ignored and model’s attribute label is always used in this situation.[/size]
[size=“2”]Has anyone faced the same problem and know, what’s going on? I’ve tried to trace thy problem up until TbInput class, but all I was able to see, was that $this->label always gets empty there.[/size]
[size=“2”]I managed to workaround this problem, by setting labels to FALSE (making them empty), hiding them at all with styles and using field’s prepend text to mimic label behavior. But since this does not work for lists and other non-input fields, I would be very happy to know, what’s going on here and how to fix this problem.[/size]
[size=“2”]I started exercises with [/size] [size=“2”]htmlOptions[‘label’] , because I’m a person, who takes maximum care about details, and such small detail like auto-adding required [/size]asterisk[size=“2”] to fields in search / filter box really pisses me off. So, my main goal was to find any way, to prevent [/size][size=“2”]TbActiveForm.[/size][size=“2”]textFieldRow[/size][size=“2”] from adding asterisk and to force it to add colon instead. So, if anyone knows any better way of achieving this goal, without using [/size][size=“2”]htmlOptions[‘label’], I would also be very happy to get to this knowledge.[/size]