This post originated from an RSS feed registered with PHP Buzz
by Stephan Schmidt.
Original Post: Unifying our example collections
Feed Title: a programmer's best friend
Feed URL: http://blog.php-tools.net/rss.php?version=1.0
Feed Description: The blog of PHP Application Tools
With the current work on patForms, patTemplate and patBBCode, we have started unifying the example collections for all our tools. For this, we have built the patExampleGen class, which manages each collection by building the navigation and tabbed example pages automatically.
Using patExampleGen has several advantages:
- It gives us a comfortable way to manage all the examples for a tool by having all example descriptions in a central location.
- It makes it easier for the developers to view the examples, as you have both the output and highlighted source code for each example directly in the examples interface.
- Depending on the tool, some additional info like the template source code for patTemplate examples is also generated automatically via the extension features of the class that enable you to add your own dumpers.
- The actual source code in the examples is kept at a minimum to be easy to understand by having the exampes framework render any needed output like the frame of the html pages.
- The tabbed interface for each example is also extensible, making it easy to add specific information on a per-example basis (like adding some extra notes, for ex.).
If you want to take a look at it, you can grab a copy of the CVS version of patForms (WebCVS), or patBBCode (WebCVS) and have a look at the examples/patExampleGen folder in the distribution. It is not currently available as a separate tool for download, but may become in the future. We welcome any comments on patExampleGen in our forum!