Programming
Article
By Harry Fuecks

Generating XUL with PHP

By Harry Fuecks
Help us help you! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

Couple of interesting PHP / XUL projects I ran into recently, experimenting with XUL generation from PHP.

First there’s a PEAR package going through the process of approval (here): PEAR::XML_XUL. This provides a DOM-like PHP API for generating XUL. Not sure how much mileage there is in that approach through; will it add much value over simply generating the XUL using strings (or templating), as is common with HTML.

Fascinating is HV WDDX Metadata, over on phpclasses (you’ll need your own account to view the code). This seems like a more promising approach. If I’ve understood it correctly, uses WDDX (a widely XML format for serializing data) to define the “widgets” which appear in an XUL form, as well as the JavaScript used to validate them on the client side. Generation is being done with XSLT in the provided example. In other words you’d just need to modify the original WDDX document to add further fields / validation to an XUL form.

Nice to see XUL being explored by PHP developers. Any more projects out there?

Other XUL news is XULPlanet now has a PHP-manual-like comment system for some of the online references and tutorials.

Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.Is it good?