ZenMagick 0.9.8


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

Class ZMEmailRule

ZMObject
└─ZMRule
└─ZMEmailRule

public class ZMEmailRule
extends ZMRule

Email validation rules.

Author:
DerManoMann
Version:
$Id: ZMEmailRule.php 2751 2009-12-17 22:45:44Z dermanomann $

Constructor Summary

ZMEmailRule(string name, string msg)

Create new email rule.

Method Summary
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
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

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

ZMEmailRule

public ZMEmailRule(string name, string msg)

Create new email rule.

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

Method Detail

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

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 94

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

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

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