XML_Functions
| From: | Guillaume Lecanu | Date: | Wed, 31 Mar 2004 14:05:25 +0000 |
| Subject: | XML_Functions | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-26892@lists.php.net to get a copy of this message | ||
Hi all,
I have adapted the mod_cgi of perl for PEAR.
Exemple of use in perl :
a({ href=> 'example.org' },
span("Go to Example.org")
)
This method make a valid XML contents.
My problem was to prefix all functions tags with the name of the package
or making an object for respect the PEAR standards.
(cf. thread "Prefix function name problem")
So, i have made an object, with an overload system ( thanks to Alan
Knowles for this advice ).
Example of use :
$x->a( array(href=>'example.org'),
$x->span("Go to Example.org")
)
My code is alpha for now, i will add documentations and after i will
propose this code on PEAR.
For more details (sources/alpha tarball/tests) :
http://lya.no-ip.com/pear/XML_Functions/
I have just one question, the overload system need to be declared like
this :
// Call the overload() function when appropriate
if (function_exists("overload") && phpversion() < 5) {
overload("XML_Functions");
}
// Create the object instance
$x = new XML_Functions();
I have put theses lines into the Functions.php file (with the class), is
you think is a good way ? or is theses lines *must* always add by the
developpers in each php files ?