ZenMagick 0.9.8


org.zenmagick.mvc.validation.rules.ZMRegexpRule
\mvc\validation\rules\ZMRegexpRule.php at line 31

Class ZMRegexpRule

ZMObject
└─ZMRule
└─ZMRegexpRule

public class ZMRegexpRule
extends ZMRule

Regexp validation rules.

Author:
DerManoMann
Version:
$Id: ZMRegexpRule.php 2751 2009-12-17 22:45:44Z dermanomann $

Constructor Summary

ZMRegexpRule(string name, string regexp, string msg)

Create new regexp rule.

Method Summary
string

getRegexp()

Get the regular expression.

void

setRegexp(string regexp)

Set the regular expression.

string

toJSString()

Create JS validation call.

boolean

validate(ZMRequest request, array data)

Validate the given request data.

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

Constructor Detail

\mvc\validation\rules\ZMRegexpRule.php at line 42

ZMRegexpRule

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

Create new regexp rule.

Parameters:
name - The field name; default is null.
regexp - The regular expression; default is null.
msg - Optional message; default is null.

Method Detail

\mvc\validation\rules\ZMRegexpRule.php at line 69

getRegexp

public string getRegexp()

Get the regular expression.

Returns:
The regular expression.

\mvc\validation\rules\ZMRegexpRule.php at line 60

setRegexp

public void setRegexp(string regexp)

Set the regular expression.

Parameters:
regexp - The regular expression.

\mvc\validation\rules\ZMRegexpRule.php at line 90

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

\mvc\validation\rules\ZMRegexpRule.php at line 80

validate

public boolean validate(ZMRequest request, array data)

Validate the given request data.

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

ZenMagick 0.9.8