Hi,
Not tested:
public function configure() {
...
# add * to required fields' labels:
foreach ($this->widgetSchema as $name => $widget)
{
if (isset($this->validatorSchema[$name]) &&
$this->validatorSchema[$name]->hasOption('required') &&
$this->validatorSchema[$name]->getOption('required') == true)
{
$label = ($widget->getLabel() != null) ?
$widget->getLabel() : $name;
$widget->setLabel($label.' *');
}
}
}
Le jeudi 15 janvier 2009 à 22:58 -0800, CiPheR a écrit :
> Does anyone know how to automatically add an indicator (like "*" or
> "required") to the labels of propel generated forms? Considering that
> the form validator already knows which fields are required, it would
> be nice if we can show the user which fields are required right away
> rather than have them submit and the come back with "required"
> validation messages.
>
> >
>
--
Thomas Dedericks
[email protected]
GSM: +32 (0) 499 23 60 22
http://tequila-studio.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---