Documentation Index

CPAINT :: Cross-Platform Asynchronous INterface Toolkit

Backend: cpaint_node.add_node()

cpaint_node Method Summary

object add_node()
void set_data()
mixed get_data()
void set_id()
string get_id()
void set_attribute()
string get_attribute()
void set_name()
string get_name()

object add_node ( string nodename [, string id ] )

adds a new subnode to the current node.




» string nodenamename of the new node
» string idid of the new node (optional)

Return Value

» object cpaint_node

API Tags

» Access: public


This method enables you to configure nested responses (for the XML and OBJECT response types).

nodename is the name of the subnode to create and will be mapped as XML tag name of the nested tag.
The optional id parameter is used to set the id attribute of the nested XML tag.

This method will return a new instance of cpaint_node which can in turn contain subnodes again, as you see fit.

Warning: In several languages, such as PHP4, you need to assign the response of cpaint_node.add_node() to a local variable by reference or else CPAINT will never know the configuration you perform on the subnode object.