ZenMagick 0.9.6


org.zenmagick.validation.rules.ZMEmailRule

Class ZMEmailRule

ZMObject
|
+--ZMRule
|
+--ZMEmailRule

public class ZMEmailRule
extends ZMRule

Email validation rules.

Author:
DerManoMann
Version:
$Id: ZMEmailRule.php 2158 2009-04-16 01:34:04Z 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(array req)

Validate the given request data.

Methods inherited from org.zenmagick.validation.ZMRule
getDefaultMsg, getErrorMsg, getJSName, getMsg, getName, toJSString, validate
Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

ZMEmailRule

public ZMEmailRule(string name, string msg)

Create new email rule.

Parameters:
name - The field name.
msg - Optional message.

Method Detail

emailRegexp

protected string emailRegexp()

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

Returns:
regexp for email matching.

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

validate

public boolean validate(array req)

Validate the given request data.

Parameters:
req - The request data.
Returns:
true if the value for $name is valid, false if not.

ZenMagick 0.9.6