Jump to content

AtkUrlAttribute: Difference between revisions

From NusaATK
No edit summary
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{attribute}}
=== Description ===
=== Description ===
The atkUrlAttribute, in combination with the AF_VALIDATE_URL flag, is used for validating URL fields.
The atkUrlAttribute, in combination with the AF_VALIDATE_URL flag, is used for validating URL fields.
Line 6: Line 8:
atkUrlAttribute($name, $flags=0, $size=0)
atkUrlAttribute($name, $flags=0, $size=0)


* name String          
;name String: Name of the attribute (the same as the fieldname used in the database)
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.
* flags (optional) int            
;size (optional) int: Size of the attribute.
Flags for the attribute. For more information about flags, please checkout the [[flags]] section.
* size (optional) int            
Size of the attribute.




Line 19: Line 18:
  $this->add(new atkUrlAttribute("url", AF_VALIDATE_URL));
  $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.
Adds a field 'url' to the node. When a URL is entered and saved, it will be validated.
[[Category:Attributes]]

Latest revision as of 17:21, 19 December 2007

Attribute: atkUrlAttribute

API docs | Flags

List of other attributes

File:AtkUrlAttribute.png
atkUrlAttribute screenshot

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.