ZenMagick 0.9.6


org.zenmagick.validation.rules.ZMRegexpRule

Class ZMRegexpRule

ZMObject
|
+--ZMRule
|
+--ZMRegexpRule

public class ZMRegexpRule
extends ZMRule

Regexp validation rules.

Author:
DerManoMann
Version:
$Id: ZMRegexpRule.php 2158 2009-04-16 01:34:04Z dermanomann $

Constructor Summary

ZMRegexpRule(string name, string regexp, string msg)

Create new regexp rule.

Method Summary
string

toJSString()

Create JS validation call.

boolean

validate(array req)

Validate the given request data.

Methods inherited from org.zenmagick.validation.ZMRule
getDefaultMsg, getErrorMsg, getJSName, getMsg, getName, toJSString, validate
Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

ZMRegexpRule

public ZMRegexpRule(string name, string regexp, string msg)

Create new regexp rule.

Parameters:
name - The field name.
regexp - The regular expression.
msg - Optional message.

Method Detail

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

validate

public boolean validate(array req)

Validate the given request data.

Parameters:
req - The request data.
Returns:
true if the regular expression does match.

ZenMagick 0.9.6