Development

Changeset 10801

You must first sign up to be able to contribute.

Changeset 10801

Show
Ignore:
Timestamp:
08/12/08 08:45:59 (3 months ago)
Author:
fabien
Message:

[doc] [1.2] added a note about the new sfValidatorSchemaCompare constants

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/branches/1.2/forms_book/en/02-Form-Validation.txt

    r10734 r10801  
    516516    $this->validatorSchema->setPostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again')); 
    517517 
     518As of symfony 1.2, you can also use the "natural" PHP operators instead of the `sfValidatorSchemaCompare` class constants. The previous example is equivalent to: 
     519 
     520    [php] 
     521    $this->validatorSchema->setPostValidator(new sfValidatorSchemaCompare('password', '==', 'password_again')); 
     522 
    518523>**Tip** 
    519524>The `sfValidatorSchemaCompare` class inherits from the `sfValidatorSchema` validator, like every global validator. `sfValidatorSchema` is itself a global validator since it validates the whole user input data, passing to other validators the validation of each field. 
  • doc/branches/1.2/forms_book/fr/02-Form-Validation.txt

    r10734 r10801  
    516516    $this->validatorSchema->setPostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again')); 
    517517 
     518A partir de symfony 1.2, vous pouvez également utiliser les opérateurs PHP plutôt que les constantes de la classe `sfValidatorSchemaCompare`. L'exemple précédent est équivalent au code suivant : 
     519 
     520    [php] 
     521    $this->validatorSchema->setPostValidator(new sfValidatorSchemaCompare('password', '==', 'password_again')); 
     522 
    518523>**Tip** 
    519524>La classe `sfValidatorSchemaCompare` hérite du validateur `sfValidatorSchema` comme tous les validateurs globaux.