propel-validator
[ class tree: propel-validator ] [ index: propel-validator ] [ all elements ]

Class: MatchValidator

Source Location: /validator/MatchValidator.php

Class Overview


A validator for regular expressions.


Author(s):

Version:

  • $Revision: 521 $

Implements interfaces:

Methods



Class Details

[line 51]
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.

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




Tags:

author:  Hans Lellelid <hans@xmpl.org>
author:  Michael Aichler <aichler@mediacluster.de>
version:  $Revision: 521 $


[ Top ]


Class Methods


method isValid [line 75]

void isValid( $map, $str)

Whether the passed string matches regular expression.



Tags:

access:  public



Implementation of:
BasicValidator::isValid()
Determine whether a value meets the criteria specified

Parameters:

ValidatorMap   $map  
   $str  

[ Top ]


Documentation generated on Thu, 22 Nov 2007 03:33:44 +0000 by phpDocumentor 1.4.0