How to force Yii 1.x to render HTML5's attribute without value, like autofocus
or readonly
in htmlOptions
array passed to anything? So, as a result I'd get for example:
<input autofocus>
I tried this idea of setting array('autofocus'=>TRUE);
or array('autofocus'=>'autofocus');
, but this does not work. It renders either <field autofocus="1">
or <field autofocus="autofocus">
and both are not, what HTML5 expects, so they don't work.
I also tried (I don't know, why did I expect this to work) array('autofocus'=>NULL);
, but such attributes are now removed by Yii 1.x and are not rendered at all.
I also tried a stupid workaround of setting this value using jQuery. But, that scares me even, if I think about it. There's got to be a better solution to this.
This seemed obvious, but I failed on finding proper answer, here on in other sources.