ZenMagick 0.9.10


org.zenmagick.mvc.validation.rules\ZMEmailRule
mvc\validation\rules\ZMEmailRule.php at line 30

Class ZMEmailRule

ZMObject
└─ZMRule
└─ZMEmailRule

public class ZMEmailRule
extends ZMRule

Email validation rules.

Author:
DerManoMann

Method Summary
void

__construct(string name, string msg, string defaultMsg)

Create new email rule.

protected string

emailRegexp()

Build email regexp.

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\rules\ZMEmailRule.php at line 38

__construct

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

Create new email rule.

Parameters:
name - The field name; default is null.
msg - Optional message; default is null.

mvc\validation\rules\ZMEmailRule.php at line 56

emailRegexp

protected string emailRegexp()

Build email regexp. see: http://php.inspire.net.nz/manual/en/function.eregi.php

Returns:
regexp for email matching.

mvc\validation\rules\ZMEmailRule.php at line 93

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

mvc\validation\rules\ZMEmailRule.php at line 77

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