[Catalyst] Rails-like form helpers - RFC for a new module
zzbbyy at gmail.com
Sun Sep 24 20:41:30 CEST 2006
In the new InstantCRUD I decided to take out the code for html forms
generation and make a separate module for it. After reading 'Rails-like
form helpers' thread I think that this module might find a more general use.
I would like to ask you what intefrace would you propose for it.
It can build the HTML::Widgets based on some config and data from the
database and then can also save the data from the widget to the database.
The config part is more complicated than it could be because the info about
many-to-many relations is not available from the schema so you need to
specify it in the config. Since it is already there I've added also the
stringification to it - as it is a bit cleaner to have it here in the
interface part than overload stringification in the database schema
The current interface is composed of just two functions:
$class, $schema, $item);
$interface_config is a hash containing info about all db classes and how to
wigetify them, $class is the db class, $schema is DBIC schema and $item is
the db row to populate values in the form - its optional.
$result is HTML::Widget::Result and $item is the db row to be updated
So my question is do you think it deserves to be taken out from InstantCRUD
and then what name would you propose for it? How would you design the API?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Catalyst