ZenMagick 0.9.6


org.zenmagick.validation.rules.ZMFieldMatchRule

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 2158 2009-04-16 01:34:04Z 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

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

ZMFieldMatchRule

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

Create new field match rule.

Parameters:
name - The field name.
other - The other fields name.
msg - Optional message.

Method Detail

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

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

ZenMagick 0.9.6