You have to implant this functionality yourself - it is not native to Yii. There are many ways to do this. This is very customized code you are asking for
class MyTable extends MyActiveRecord
...
public function attributeHelp()
{
return array ('field1' => 'helptext for field 1',
'field2' => 'helptext for field f2',
etc.
)
}
extend CActiveRecord, add getter for the HelpText
class MyActiveRecord extends CActiveRecord
{
public function getAttributeHelp($attribute)
{
$help=$this->attributeHelp();
if(isset($help[$attribute]))
return yii::t('MyApp',$help[$attribute]);
}
}
extend CHtml to automatically add tooltips (as Title attribute) to activeLabelEx()
class MyHtml extends CHtml
{
public static function activeLabelEx($model,$attribute,$htmlOptions=array())
{
$realAttribute=$attribute;
self::resolveName($model,$attribute); // strip off square brackets if any
$htmlOptions['required']=$model->isAttributeRequired($attribute,self::$scenario);
$htmlOptions['title']=$model->getAttributeHelp($attribute); // + JJD
return self::activeLabel($model,$realAttribute,$htmlOptions);
}
}