Documentation

dataxchg

Set of functions for data format exchange.

Methods

hashToXml

Converts a structure to XML. It is suggested to use XML_Serializer or SimpleXML.

hash2Xml

Converts a hash (alphanumeric array) to XML.

xml2Hash

The inverse of the previous function.

param2Hidden

Receives a hash and returns the HTML code corresponding to a series of hidden values. Useful for creating POST-type forms.

param2Get

Also receives a hash and returns it as a series of values ​​concatenated by &. Useful for creating GET links.

The following functions are now deprecated and are retained only for backwards compatibility. A redesign is required.

ah2NavList

Receives an array containing a list of hashes, each with the structure indicated below, returning a list of items (li).

type
If 'void' returns a single element with no content
class
Class to add to the item (class)
href
Link to page (href)
params
Parameters specified for the link (?params)
icon
Icon contained in the link (img)
name
Name specified in the link

ah2OrderedList

Similar to the above, but returns an ordered list.
It also receives a list with a similar structure as a parameter, also indicating the identifier (id), name (data), and class (class) of the list.

ah2RadioList

Similar to the above, generating a list of radio buttons, but adds two new fields to the elements.

checked
Indicates whether the radio button is selected
disabled
Indicates whether the button is disabled

ah2CheckboxList

Similar to the above, generating a list of checkboxes.

ah2Select

Similar to the above, generating a select list of options.

Search