[Catalyst] automatic form generation based on data models
Bill Moseley
moseley at hank.org
Wed Nov 8 20:13:53 GMT 2006
On Wed, Nov 08, 2006 at 02:46:02PM -0500, marcus baker wrote:
> Having this capability might do well to entice more novice developers
> to Catalyst due to this next step in ease of use and getting a quick
> app running... It seemed to do well for the Rails camp. Hopefully
> from there people would then pick through and start pieceing together
> for themselves how the underpinnings work, but that's up to them.
Well, in my case currently this is all I'd need to do:
[% # Template to generate a standard form
WRAPPER form_wrapper;
FOR f = form.fields;
field(form, f );
END;
END;
%]
The point is that once you have your form interface setup
auto-generating forms would be an easy step. I just find it not that
much harder to do even the simple forms by hand.
The only difference with how I do it now is that my real forms look
more like:
WRAPPER form_wrapper;
'<fieldset><legend>Personal Information</legend>';
field(form, 'first_name', 'First Name');
field(form, 'last_name', 'Last Name');
field(form, 'phone', 'Phone', 'Please include area code');
'</fieldset>';
'<fieldset><legend>Account Information</legend>';
....
'</fieldset>';
END;
END;
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list