Represents hint for a form field. If hint is empty, field part will be hidden.
Form model:
final class CreateForm extends FormModel
{
public ?string $name = null;
public function getAttributeHints(): array
{
return [
'name' => 'Input your full name.',
];
}
}
Widget:
echo Hint::widget()->formAttribute($createForm, 'name');
Result will be:
<div>Input your full name.</div>