ZenMagick 0.9.8


org.zenmagick.store.mvc.validation.ZMMinRule
\store\mvc\validation\ZMMinRule.php at line 31

Class ZMMinRule

ZMObject
└─ZMRule
└─ZMMinRule

public class ZMMinRule
extends ZMRule

Min max length validation rules.

Author:
DerManoMann
Version:
$Id: ZMMinRule.php 2694 2009-12-03 22:32:18Z dermanomann $

Constructor Summary

ZMMinRule(string name, int min, string msg)

Create new min length rule.

Method Summary
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
getDefaultMsg, getErrorMsg, getJSName, getMsg, getName, setDefaultMsg, setMsg, setName, toJSString, validate
Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\store\mvc\validation\ZMMinRule.php at line 42

ZMMinRule

public ZMMinRule(string name, int min, string msg)

Create new min length rule.

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

Method Detail

\store\mvc\validation\ZMMinRule.php at line 72

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

\store\mvc\validation\ZMMinRule.php at line 82

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

\store\mvc\validation\ZMMinRule.php at line 62

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