[Catalyst] CC::FormBuilder woes
jc5826 at gmail.com
Fri Apr 27 23:35:08 GMT 2007
On 4/27/07, RA Jones <ra.jones at dpw.clara.co.uk> wrote:
> Peter Edwards wrote:
> If fields is a list reference you need something like
> [% form.fields.0.label %]
> Oh dear, that works! But it's not what I want as I can't easily force
> specific fields where I want them spatially if I have to loop over an array.
> I want some table rows to contain 3 fields, and others to contain one or
> two. I can do this if manipulating a hash(ref), but with an array(ref) it is
> very messy.
> The CGI::FormBuilder::Template::TT2 documentation distinctly gives the
> impression I can retrieve fields from the form.field hash:
> You can access individual fields via the field variable. For a field
> named... The field data is in...
> -------------------- -----------------------
> job [% form.field.job %]
> size [% form.field.size %]
> email [% form.field.email %]
> Then use eg form.field.location.label in the template. I have done this
> previously using CGI::FormBuilder in a stand-alone environment, so I must be
> missing something obvious here.
Hmm, that is odd. There is actually a unit test that is included to
test that specific functionality out.
Maybe there is an unexpected stash issue. Try to create a minimalist
example (with form, template and controller code) and post here.
More information about the Catalyst