id attribute and CHtml::label

Hi, I have this:

echo CHtml::label(Yii::t('demo', 'Nombre: '), 'nombre');


echo CHtml::textField('nombre', '', array('title'=>Yii::t('demo', 'Escriba su nombre')));

I get this:

[tt]line 9 column 116 - Info: reference to non-existent ID "nombre"[/tt]

If I do this:

echo CHtml::label(Yii::t('demo', 'Nombre: '), 'nombre');


echo CHtml::textField('nombre', '', array('id'=>'nombre','title'=>Yii::t('demo', 'Escriba su nombre')));

the XHTML code validates OK. Will I need to put ‘id’=>‘nombre’ always in my input fields’ options? IMHO it would be better if the id attribute rendered as the name attribute…  ::)

Done.

Thanks Qiang!