[Catalyst] More than one form per page with C::C::FormBuilder?
Danny Warren
danny at io.com
Mon Feb 12 11:56:07 GMT 2007
Yea, I was thinking of something along those lines. One idea I was
playing with was creating a new base controller that inherits from
C::C::FormBuilder, and sets the stashed variables based on the form name
(from the *.fb config files). That is the least-hacky thing I can think
of that lets me keep all the niceness without a bunch of extra code in
each action.
One bonus to that is that it removes visual ambiguity in the templates
as to which form is being rendered. Will post back if that works
decently, but I am still open to ideas if others have solved this one
already.
Thanks!
Danny
Robert 'phaylon' Sedlacek wrote:
> Danny Warren wrote:
>> What I end up with when viewing the "foo" action page is two
>> "foo_search" forms. I understand why this happening, from an internals
>> standpoint, but I am not sure how to get around it without ugly hacking.
>> I would like to be able to keep the niceness of the "Form" pragma in
>> the controller and all the cool things that go along with it.
>
> I haven't done it, but I guess you could do one form per controller by
> changing the stashed variable names in the controller configuration.
>
More information about the Catalyst
mailing list