Difference between revisions of "NXSL:SetCustomAttribute"
Jump to navigation
Jump to search
Tomas Kirnak (talk | contribs) |
|||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Set value of node's custom attribute. If attribute was not defined, it will be created | Set value of node's custom attribute. If attribute was not defined, it will be created. | ||
'''Since:''' 1.1.1 | '''Since:''' 1.1.1 | ||
Line 19: | Line 19: | ||
== Return Value == | == Return Value == | ||
Previous value of custom attribute or '''NULL''' if attribute was not defined before. | Previous value of requested custom attribute or '''NULL''' if attribute was not defined before. | ||
== Examples == | == Examples == |
Revision as of 09:53, 22 October 2014
Set value of node's custom attribute. If attribute was not defined, it will be created.
Since: 1.1.1
Syntax
SetCustomAttribute(node, attributeName, value)
Parameters
node | Node object, you can use predefined variable $node to refer to current node. You can also use null as node if trusted nodes check is disabled (see Security Issues for more information). |
attributeName | Custom attribute name. |
value | New value for custom attribute. |
Return Value
Previous value of requested custom attribute or NULL if attribute was not defined before.
Examples
SetCustomAttribute($node, "my_attribute", "new value") -> "old value" SetCustomAttribute($node, "non_existing_attribute", "new value") -> NULL