ZMObject
|
+--ZMRule
|
+--ZMWrapperRule
public class ZMWrapperRule
extends ZMRule
| Constructor Summary | |
|---|---|
ZMWrapperRule(string name, string msg, mixed function) Create new rule. |
|
| Method Summary | |
|---|---|
| void | setFunction(string function) Set the validation function. |
| void | setJavaScript(string javascript) Set the JavaScript validation code. |
| string | 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 | |
public ZMWrapperRule(string name, string msg, mixed function)
Create new rule.
public void setFunction(string function)
Set the validation function.
The function must implement the same siganture as validate($req).
public void setJavaScript(string javascript)
Set the JavaScript validation code.
public string toJSString()
Create JS validation call.
public boolean validate(array req)
Validate the given request data.
true if the value for $name is valid, false if not.
Empty validation rules that can be used to wrap custom logic.