ZMObject
└─ZMRule
└─ZMRequiredRule
public class ZMRequiredRule
extends ZMRule
| Method Summary | |
|---|---|
| void | __construct(string name, string msg, string defaultMsg) Create new required rule. |
| void | setName(string name) {@inheritDoc} |
| string | 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 | |
public void __construct(string name, string msg, string defaultMsg)
Create new required rule.
If a list of names is specified, validation is considered teh existence of at least one.
null.public void setName(string name)
Set the parameter name this rule is validating.
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.
Required validation rules.