[Catalyst] Automatic structure creation from form data

Mark Zealey mark at itsolve.co.uk
Tue Jul 3 19:53:03 GMT 2007


check out Catalyst::Controller::FormBuilder - it'll autogenerate your forms 
for you, handle validation etc etc.

M

On Tuesday 03 July 2007 7:19 pm, Andrew Hayward wrote:
> I'm relatively new to this Catalyst malarkey, so you'll have to bear
> with me for a minute.
>
> I was wondering if it possible to construct an HTML form such that the
> back end automatically creates a hash (or an array) based on the naming
> scheme.
>
> For example...
>
> <form>
>    <input name="items[0][name]" value="...">
>    <input name="items[0][description]" value="...">
>    <input name="items[1][name]" value="...">
>    <input name="items[1][description]" value="...">
>    ...
> </form>
>
> ...giving...
>
> $c->request->parameters->{items}->[0]->{name}
> ...etc (which itself is probably incorrect!)
>
>
> If I'm barking up the wrong tree, or just plain barking, then please
> excuse me. I know it can be done in other server-side languages (yes,
> I'm more used to PHP), and I figured it might be something that other
> people have tried in the past.
>
>
> Thanks,
>
> - Andrew
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/



More information about the Catalyst mailing list