ZMObject
└─ZMRule
└─ZMMinMaxRule
public class ZMMinMaxRule
extends ZMRule
| Constructor Summary | |
|---|---|
ZMMinMaxRule(string name, int min, int max, string msg) Create new min/max length rule. |
|
| Method Summary | |
|---|---|
| string | Return an appropriate error message. |
| int | getMax() Get the maximum length. |
| int | getMin() Get the minimum length. |
| void | setMax(int max) Set the maximum length. |
| void | setMin(int min) Set the minimum length. |
| string | 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 | |
public ZMMinMaxRule(string name, int min, int max, string msg)
Create new min/max length rule.
null.public string getErrorMsg()
Return an appropriate error message.
public int getMax()
Get the maximum length.
public int getMin()
Get the minimum length.
public void setMax(int max)
Set the maximum length.
public void setMin(int min)
Set the minimum length.
public string toJSString()
Create JS validation call.
public boolean validate(ZMRequest request, array data)
Validate the given request data.
true if the value for $name is valid, false if not.
Min/max length validation rule.