root/trunk/examples/patExampleGen/xmlSource.php

Revision 117, 0.7 kB (checked in by argh, 4 years ago)

Massive update of the examples collection; added the patExampleGen examples framework; commented all examples; reworked all the templates...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /**
3  * helper script that displays the XML source of all elements in a form.
4  *
5  * $Id$
6  *
7  * You may pass the following GET parameters to the
8  * script:
9  *
10  * - example => id of the example
11  *
12  * @package        patForms
13  * @subpackage    Examples
14  * @author        Sebastian 'The Argh' Mordziol <argh@php-tools.net>
15  */
16
17     if( !isset( $_GET['example'] ) )
18         die( 'No example selected.' );
19     
20     $exampleId = $_GET['example'];
21     
22     ob_start();
23
24     // needed so that the example file is in the right place
25     chdir( '../' );
26         
27     require $exampleId.'.php';
28     
29     ob_end_clean();
30     
31     if( !isset( $form ) )
32     {
33         die( 'Elements source is not available for this example.' );
34     }
35
36     foreach( $form->elements as $row => $el )
37     {
38         echo $el->serialize()."\n\n";
39     }
40 ?>
Note: See TracBrowser for help on using the browser.