[Catalyst] help with Catalyst::Plugin::Form::Processor
Michael Higgins
linux at evolone.org
Thu Dec 6 18:22:09 GMT 2007
On Thu, 6 Dec 2007 10:16:05 -0800
Michael Higgins <linux at evolone.org> wrote:
[8<]
>
>
> Thanks a lot for your replies. Yes I did set up and use the example
> application. The problem is, I can't make any sense out of the
> templates, which seem to do all the work. :(
>
> I can make simple templates, no process, block or wrapper. So, I'm
> trying to iterate, somehow, in some rational order, even sorted would
> be fine, to expose all the fields in my form.
>
> No wrapper, no Template magic, just the fields I've set up in the same
> order each time. With labels, or any other key information, would be
> nice...
>
> So, what is the simplest example of returning the form object fields
> in a form in TT?
>
> Right now, I'm doing this:
[Hitting some key combo that sends an email before I'm done writing... ]
Manually set up the form:
<form name="boldata" action="[% Catalyst.uri_for('/banpdfs/Create_bol')
%]" method="post"> <fieldset>
<legend>Data</legend>
Manually set up the order of fields:
[% SET fieldlist = ['sh_name','cn_name'] %]
That reference my labels:
[% FOREACH labk IN fieldlist %]
I can expose the form field, finally:
[% SET f = form.field(labk) %]
<p><label for="[% f.name %]">[% labels.$labk %]</label><input type="[%
f.type %]" name="[% f.name %]" id="[% f.name %]" value="[% f.value %]">
</p>
[% END %]
</fieldset>
<fieldset>
</fieldset>
<INPUT type="submit" value="get_bol"><INPUT type="reset"
value="reset form"> </form>
. . .
What can I do with C::P::Form::Processor (aside from trying to hook
this to my DBIC classes) to make this more... 'elegant'? ;-)
Thanks again.
Cheers,
--
|\ /| | | ~ ~
| \/ | |---| `|` ?
| |ichael | |iggins \^ /
michael.higgins[at]evolone[dot]org
More information about the Catalyst
mailing list