Hi,

I am trying to get hold of the Template Toolkit views.

If I make a .tt2 file like

[% form.render %]

all form fields are showing up - OK.

Now I want do my own layout and as I understood the DOCS all
fields are saved in a hash field or array fields.

All my fields are  defined in a .fb file

If I do:

[% FOREACH field IN form.fields %]
        <tr>
                <td>[% field.label %]</td>
                <td>[% field.name %]</td>
                <td>[% field.field %]</td>
        </tr>
[% END %]

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)


Lets say I have a field named 
firstname then it should be possible to do:

[% form.fields.firstname.label %]

BUT NOTHING SHOWS UP.


I have tried to create a testhash in the controller like:

my %testhash;
$testhash{firstname} = "myname";
$c->stash->{testhash} = \%testhash;

and I have no problem using:

[% testhash.firstname %]

in the .tt2 file

What am i missing or what have I overlooked??


Regards 


Peter Sørensen/University of Southern Denmark/email: [EMAIL PROTECTED]

_______________________________________________
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/

Reply via email to