[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/propel/validator/ -> MatchValidator.php (sommaire)

(pas de description)

Poids: 81 lignes (3 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

MatchValidator:: (2 méthodes):
  prepareRegexp()
  isValid()


Classe: MatchValidator  - X-Ref

A validator for regular expressions.

This validator will return true, when the passed value *matches* the
regular expression.

## This class replaces the former class MaskValidator ##

If you do want to test if the value does *not* match an expression,
you can use the MatchValidator class instead.

Below is an example usage for your Propel xml schema file.

<code>
<column name="email" type="VARCHAR" size="128" required="true" />
<validator column="username">
<!-- allow strings that match the email adress pattern -->
<rule
name="match"
value="/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/"
message="Please enter a valid email address." />
</validator>
</code>

prepareRegexp($exp)   X-Ref
Prepares the regular expression entered in the XML
for use with preg_match().

param: string $exp
return: string Prepared regular expession.

isValid(ValidatorMap $map, $str)   X-Ref
Whether the passed string matches regular expression.




Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7