Ordering attributes within a node: Difference between revisions
Appearance
No edit summary |
|||
| Line 6: | Line 6: | ||
If you don't pass this parameter, ATK will use increments of 100, starting with 100 for the first atttribute. So if you add an attribute later on, and want it to appear between the first and second attribute, pass 150 as third parameter, like this: | If you don't pass this parameter, ATK will use increments of 100, starting with 100 for the first atttribute. So if you add an attribute later on, and want it to appear between the first and second attribute, pass 150 as third parameter, like this: | ||
< | <syntaxhighlight lang="php"> | ||
$this->add(new atkAttribute("value"), NULL, 150); | $this->add(new atkAttribute("value"), NULL, 150); | ||
</ | </syntaxhighlight> | ||
Revision as of 13:47, 14 January 2007
|
ATK Howto: Ordering attributes within a node
|
Ordering attributes within a node
By default, the order in which attributes appear in a node is based on the order in which they are added to it. You can influence this however by passing a positive integer as third parameter to atkNode's add() method.
If you don't pass this parameter, ATK will use increments of 100, starting with 100 for the first atttribute. So if you add an attribute later on, and want it to appear between the first and second attribute, pass 150 as third parameter, like this:
$this->add(new atkAttribute("value"), NULL, 150);