ZenMagick 0.9.10


org.zenmagick.mvc.validation.rules\ZMFieldMatchRule
mvc\validation\rules\ZMFieldMatchRule.php at line 32

Class ZMFieldMatchRule

ZMObject
└─ZMRule
└─ZMFieldMatchRule

public class ZMFieldMatchRule
extends ZMRule

Field match rule.

This is mostly to match new and confirm password.

Author:
DerManoMann

Method Summary
void

__construct(string name, string other, string msg, string defaultMsg)

Create new field match rule.

string

getErrorMsg()

Return an appropriate error message.

string

getOther()

Get the other field name.

void

setOther(string other)

Set the other field name.

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
__construct, getDefaultMsg, getErrorMsg, getJSName, getMsg, getName, setDefaultMsg, setMsg, setName, toJSString, validate
Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

mvc\validation\rules\ZMFieldMatchRule.php at line 43

__construct

public void __construct(string name, string other, string msg, string defaultMsg)

Create new field match rule.

Parameters:
name - The field name; default is null.
other - The other fields name; default is null.
msg - Optional message; default is null.

mvc\validation\rules\ZMFieldMatchRule.php at line 91

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

mvc\validation\rules\ZMFieldMatchRule.php at line 70

getOther

public string getOther()

Get the other field name.

Returns:
The other fields name.

mvc\validation\rules\ZMFieldMatchRule.php at line 61

setOther

public void setOther(string other)

Set the other field name.

Parameters:
other - The other fields name.

mvc\validation\rules\ZMFieldMatchRule.php at line 101

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

mvc\validation\rules\ZMFieldMatchRule.php at line 81

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 value for $name is valid, false if not.

ZenMagick 0.9.10