One day I needed a simple form for list subscription that needed a CAPTCHA image and I didn’t want to go through the trouble of trying to crowbar it into any of the “complex” PEAR form packages.

So I thought “why not build something really simple and lightweight that will create and validate a simple form?” I wanted three methods: create, validate, and save. Sweet, simple, easy to code.

That might not have been the smartest thing I ever did.
The first version worked reasonably well. Then I needed another simple form. Hello “create($formType)”. Then I needed to send the results via mail. Then I needed “just one” extra field.

And so it went.

Some time later, RapidForm still remains more or less true to the original requirement, but it has had one heck of a case of feature creep. Now it’s possible to add multiple columns, a variety of field types, render the forms through a view class, hook methods into form events, and so on.

As RapidFrom migrated to PHP5 it gained a good deal of architectural clarity and a lot more power, but it was still organized much like its PHP4 version. It was a little clunky.

Yesterday I needed to update an application. It used an older version of RapidForm and hadn’t tracked some API changes, so I decided to fix things from the ground up. An intense set of massive edits later, and RapidForm (now AP5L_Forms_Rapid) is passing basic unit tests and is happily reintegrated into the application. The PHPdoc comments still have a way to go before they’re up to standard, but as usual the test bench provides a pretty good set of examples on how to use it.

The code is available from ap5l.googlecode.com.

Mastodon