FormProcessor has basic array handling!

Well, after many more hours of work than I care to remember, FormProcessor has basic handling of arrays (i.e. form fields with names like @field[]@). Only the ability to fill in fields is currently present; validation won’t work. Also, I’ve not tested this with any type of form extensively, so something may well be broken.

Having issued the warnings, you can get the code and my basic test suite @ “http://peter.mapledesign.co.uk/quests/formprocessor/code/array_capable/”:http://peter.mapledesign.co.uk/quests/formprocessor/code/array_capable/

I’m hoping it’s not _too_ much slower than the original - there’s certainly a lot more code present, and many more method calls (wherever it used to look in @$this->data@ for a value it now calls @$this->_get_data()@ instead) so I do expect a slow-down. It’ll be interesting to benchmark it (or see some benchmarks if someone else does them )

I started hacking the code to do this as someone was going to pay me to improve “sendcard”:http://www.sendcard.org/ using it. Now they’ve decided they can’t afford to, so I’m left with a half-finished piece of code. Which I’m sure will be useful once it’s finished :-)

4 comments ↓

#1 David Weingart on 09.24.03 at 5:05 pm

Perhaps I’m not the brightest bulb, but I don’t think I can download the PHP source for FormProcessor because the files have a “.php” extensions, and are thus being interpreted on the server.

Would it be possible to post a zip for download?

I’ve thought of doing something exactly like this for a while, so I’d like to jump in and get my hands dirty with the code :)
Thanks, -dave

#2 Peter Bowyer on 09.24.03 at 7:36 pm

I’ve fixed this

#3 kyle on 11.04.03 at 1:27 am

Just curious - the HTMLSax file it requires at the beginning? What is that? A PEAR thing? Does the class work without PEAR? Is there somewhere I can download the required file?

#4 Peter Bowyer on 11.08.03 at 2:43 pm

Yes, it’s part of PEAR. And no, you need PEAR installed now to use the class - with any recent build of PHP you should have got the basics of PEAR - just download this extra package and you’re ready to go.

Leave a Comment