ZenMagick 0.9.8


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

Class ZMFieldMatchRule

ZMObject
└─ZMRule
└─ZMFieldMatchRule

public class ZMFieldMatchRule
extends ZMRule

Field match rule.

This is mostly to match new and confirm password.

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

Constructor Summary

ZMFieldMatchRule(string name, string other, string msg)

Create new field match rule.

Method Summary
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
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\ZMFieldMatchRule.php at line 44

ZMFieldMatchRule

public ZMFieldMatchRule(string name, string other, string msg)

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.

Method Detail

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

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

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

getOther

public string getOther()

Get the other field name.

Returns:
The other fields name.

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

setOther

public void setOther(string other)

Set the other field name.

Parameters:
other - The other fields name.

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

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

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

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.8