little grey description text for form fields


is there a Yii way to add nice description-text to a form input field? either left or right … something like this




A skeleton app has a stylesheet css/form.css which includes an appropriate hint style.  Unlike the example you cite, this hint style only applies to paragraph tags.  However. it is easy enough to remove the restriction in form.css.  Then:

<span class="hint">My hint</span>

will give you what you want.

You may want to add an attributeHint function to your models in order to keep all your hints in one place.  You may also want to extend CHtml to add a function which writes a hint if defined in the model (presumably supplied as a function parameter) and no-ops otherwise.  I know of no Yii functionality which does that work for you, but is easy enough to do yourself.

thanks, that'll help