* @license LGPL, see license.txt for details * @link http://www.php-tools.net */ /** * Main examples prepend file, needed *only* for the examples framework! */ include_once 'patExampleGen/prepend.php'; $exampleGen->displayHead( 'Example' ); // EXAMPLE START ------------------------------------------------------ /** * main patForms class */ require_once $neededFiles['patForms']; /** * patErrorManager class */ require_once $neededFiles['patErrorManager']; /** * localisation stuff */ require_once $neededFiles['patI18n_configure']; // attribute collection for the element $attributes = array( 'required' => 'yes', 'display' => 'yes', 'edit' => 'yes', 'label' => 'Username', 'description' => 'Enter your username here.', 'default' => 'Tom & Jerry', 'title' => 'Username', ); // create the element $el = patForms::createElement( 'toXML', 'String', $attributes ); // display the element echo $el->getAttribute( 'label' )."
"; echo "
".$el->serialize()."
"; echo "".$el->getAttribute( 'description' )."

"; // serialize the element to xml $xml = $el->toXML(); // display the xml (we use the example framwrok's XML hilighter for this) echo 'XML output:

'; $exampleGen->displayXMLString( $xml ); // EXAMPLE END ------------------------------------------------------ $exampleGen->displayFooter(); ?>