ZenMagick 0.9.10


zenmagick.store.shared.mvc.validation\ZMMinRule
mvc\validation\ZMMinRule.php at line 30

Class ZMMinRule

ZMObject
└─ZMRule
└─ZMMinRule

public class ZMMinRule
extends ZMRule

Min max length validation rules.

Author:
DerManoMann

Method Summary
void

__construct(string name, int min, string msg, string defaultMsg)

Create new min length rule.

string

getErrorMsg()

Return an appropriate error message.

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
__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

Method Detail

mvc\validation\ZMMinRule.php at line 41

__construct

public void __construct(string name, int min, string msg, string defaultMsg)

Create new min length rule.

Parameters:
name - The field name.
min - The minimun length.
msg - Optional message.

mvc\validation\ZMMinRule.php at line 71

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

mvc\validation\ZMMinRule.php at line 81

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

mvc\validation\ZMMinRule.php at line 61

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