On Jan 17, 2008, at 2:39 AM, Peter Sørensen wrote:
I don't know much about FormBuilder, however...
The output is OK but as I understood the docs it should also
be possible to access this directly.
[% fields %] - List of fields
[% field %] - Hash of fields (for lookup by name)
These are actually exactly the same method in CGI::FormBuilder, which
says:
*param = \&field;
*params = \&field;
*fields = \&field;
sub field {
Lets say I have a field named
firstname then it should be possible to do:
[% form.fields.firstname.label %]
The source for CGI::FormBuilder says that field, if called without an
argument, will return "an array of the names in list context, and a
hashref of name/value pairs in a scalar context". This is problematic
behavior with TT, as TT always uses a list context, so form.fields and
form.field are both going to return an array of field names.
Looking at the source though, it looks like you should be able to get
at them this way:
[% form.field( 'firstname' ).label %]
--
Jason Kohles, RHCA RHCDS RHCE
[EMAIL PROTECTED] - http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/