AtkBoolAttribute: Difference between revisions
Appearance
m Atkboolattribute moved to AtkBoolAttribute |
No edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{attribute}} | |||
The '''atkBoolAttribute''' is used for 'yes or no' fields. Depending on your database it uses a boolean field, tinyint or a textfield of 1 character length. | |||
== Params == | |||
The constructor of the atkBoolAttribute has the following params: | The constructor of the atkBoolAttribute has the following params: | ||
atkBoolAttribute($name, $flags=0) | atkBoolAttribute($name, $flags=0) | ||
* name String | * '''name''' ''String'' | ||
Name of the attribute (the same as the fieldname used in the database) | |||
* '''flags''' (optional) ''Integer'' | |||
Flags for the attribute. For more information about flags, please checkout the [[flags]] section. | |||
== Examples == | |||
(in a [[node]] constructor): | (in a [[node]] constructor): | ||
| Line 19: | Line 21: | ||
$this->add(new atkBoolAttribute("receive_mailinglist",AF_OBLIGATORY)); | $this->add(new atkBoolAttribute("receive_mailinglist",AF_OBLIGATORY)); | ||
The same, but the field is obligatory. | The same, but the field is obligatory. | ||
[[Category:Attributes]] | |||
Latest revision as of 17:23, 19 December 2007

The atkBoolAttribute is used for 'yes or no' fields. Depending on your database it uses a boolean field, tinyint or a textfield of 1 character length.
Params
The constructor of the atkBoolAttribute has the following params:
atkBoolAttribute($name, $flags=0)
- name String
Name of the attribute (the same as the fieldname used in the database)
- flags (optional) Integer
Flags for the attribute. For more information about flags, please checkout the flags section.
Examples
(in a node constructor):
$this->add(new atkBoolAttribute("receive_mailinglist"));
Adds a field 'receive_mailinglist' to the node. In the admin this will be displayed as a yes/no selection with the possibility to not select any value.
$this->add(new atkBoolAttribute("receive_mailinglist",AF_OBLIGATORY));
The same, but the field is obligatory.