Philip Crow > Bigtop > docs/keyword_cookbook/field/html_form_foreign/discussion

Download:
Bigtop-0.38.tar.gz

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Source  

USE ^

All field keywords beginning with html_form_ are passed directly into the form hash. Thus, they are really defined in form.tt which ships with Gantry.

html_form_foreign applies only when the field's html_form_type is display. It indicates that this field is a foreign key and foreign_display should be used to get a human readable value to display instead of showing the rather meaningless foreign row id.

Note that this keyword is usually used when two different versions of a form are presented depending on the context. The base form uses html_form_type select and html_form_foreign is ignored. Later, another form is displayed (to a less priviledged user) which uses html_form_type display. The form type is usually switched with the Gantry::Utils::FormMunger.

EXAMPLE ^

To see an example, build:

    bigtop -c example.bigtop all

Change to the newly created Kids directory and look in the form method in lib/Kids/GEN/Child.pm. Note the use of data statements to populate the table. See the pod for Gantry::Utils::FormMunger for a more natural approach.

syntax highlighting: