Jump to content

AtkUrlAttribute

From NusaATK
Revision as of 10:23, 28 December 2006 by bahtiar (talk | contribs)

Description

The atkUrlAttribute, in combination with the AF_VALIDATE_URL flag, is used for validating URL fields.

Params

The constructor of the atkUrlAttribute has the following params: atkUrlAttribute($name, $flags=0, $size=0)

name String
Name of the attribute (the same as the fieldname used in the database)
flags (optional) int
Flags for the attribute. For more information about flags, please checkout the flags section.
size (optional) int
Size of the attribute.


Examples

(in a node constructor):

$this->add(new atkUrlAttribute("url", AF_VALIDATE_URL));

Adds a field 'url' to the node. When a URL is entered and saved, it will be validated.