1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| class CetForm extends BaseCetForm
{
public function configure()
{
$this->setWidgets(array(
'id_cet' => new sfWidgetFormInputHidden(),
'annee' => new sfWidgetFormInputText(array('label'=>''),array('maxlength'=>4,'size' => 20)),
'jours' => new sfWidgetFormInputText(),
'montant' => new sfWidgetFormInputText(),
));
$this->setValidators(array(
'id_cet' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id_cet', 'required' => false)),
'annee' => new glValidatorAnd(array(
new glValidatorExistance(array('table'=>'Cet','champ'=>'annee','existe'=>false,'required'=>true),array('inexistance'=>"Année déja existante.",'required'=>"Ce champs est obligatoire")),
new glValidatorInteger(array('min' => 0,'max' => 9999,'required'=>true),array('required'=>"Ce champs est obligatoire")),
)),
'jours' => new glValidatorNumber31(array('partie_entiere'=>3,'partie_flotante'=>1,'required' => true)),
'montant' => new glValidatorNumber92(array('partie_entiere'=>9,'partie_flotante'=>2,'required' => true)),
));
$this->widgetSchema->setNameFormat('cet[%s]');
}
} |
Partager