[sf-perl] Favorite form validation modules?
moseley at hank.org
Wed Jan 6 14:38:35 PST 2010
I wrote and use Form::Processor.
I have used a number of modules for validation. Most were about specifying
forms via a config file and rendering HTML markup. I really like
Rose::HTML::Objects, but found myself customizing it to the point where I
realized I should just start from scratch.
I was less interested in rendering mark up. That's pretty easy anyway, and
I also need custom markup more often than not so the automatic rendering
never quite worked for me.
I was more interested in the other side -- where the data comes and goes
from the store (mostly database). So, Form::Processor can work with ORMs,
for example, to automatically populate lookup lists and update many-to-many
I also need more than config-based validation parameters. In
Form::Processor fields and forms are classes. So adding new custom fields
is easy, and forms can contain methods to do much more complex things than
can be done with config-based forms. And, of course, forms can inherit from
other forms as can fields.
I was also interested in removing much of the code I felt I was repeating
often in controllers. For an example see:
There's two or three "model" classes for Form::Processor -- they basically
interface with a specific ORM. I used Class::DBI quite a bit so that's the
one I wrote. Gerda Shank wrote one for DBIx::Class. I'm using a customized
verion of the DBIx::Class one now -- the one Gerda wrote tries to cover more
situations but as a result has some bugs.
Gerda also attempted to rewrite Form::Processor using Moose instead of
Rose::Object. I could never get it to pass my test suite and didn' t have
time to work on it. So, Gerda released HTML::FormHandler which is based on
Form::Processor. I've been meaning to try it with a project some day soon.
I'd recommend trying it.
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SanFrancisco-pm