Changeset 10173
- Timestamp:
- 07/07/08 18:55:04 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.2/forms_book/en/02-Form-Validation.txt
r10100 r10173 258 258  259 259 260 The default error message related to this error code (`min_length`) is different from the messages we already went over, since it implements two dynamic values: the user input data (`foo`) and the minimum number of characters allowed for this field (`4`). Listing 2-5 customizes this message using theses dynamic values and Figure 2- 8shows the result.260 The default error message related to this error code (`min_length`) is different from the messages we already went over, since it implements two dynamic values: the user input data (`foo`) and the minimum number of characters allowed for this field (`4`). Listing 2-5 customizes this message using theses dynamic values and Figure 2-7 shows the result. 261 261 262 262 Listing 2-5 - Customizing the Error Messages with Dynamic Values … … 272 272 'name' => new sfValidatorString(array('required' => false)), 273 273 'email' => new sfValidatorEmail(array(), array('invalid' => 'Email address is invalid.')), 274 'subject' => new sfValidatorChoice(array('choices' => array_keys( $subjects))),274 'subject' => new sfValidatorChoice(array('choices' => array_keys(self::$subjects))), 275 275 'message' => new sfValidatorString(array('min_length' => 4), array( 276 276 'required' => 'The message field is required', doc/branches/1.2/forms_book/fr/02-Form-Validation.txt
r10100 r10173 272 272 'name' => new sfValidatorString(array('required' => false)), 273 273 'email' => new sfValidatorEmail(array(), array('invalid' => 'L\'adresse email est invalide.')), 274 'subject' => new sfValidatorChoice(array('choices' => array_keys( $subjects))),274 'subject' => new sfValidatorChoice(array('choices' => array_keys(self::$subjects))), 275 275 'message' => new sfValidatorString(array('min_length' => 4), array( 276 276 'required' => 'Le champ message est obligatoire.',